A modular HTTPS proxy server for connecting Discord-compatible clients to Spacebar and other open-source chat backends. This proxy intercepts Discord client requests and routes API/WebSocket traffic to your self-hosted Spacebar instance while serving Discord's web interface.
SpaceProx sits between the official Discord client (web or desktop via proxy settings) and backend services:
- API/Gateway routes (
/api,/gateway) → Your Spacebar instance - App routes (
/app,/login, etc.) → Discord.com (interface content)
This enables using the familiar Discord interface with a fully self-hosted, open-source backend.
- Multi-Instance Support: Route to different Spacebar instances via headers, cookies, or query params
- Plugin System: Inject custom CSS, JavaScript, and HTML into the Discord interface
- HTTPS Proxy: Full SSL/TLS termination with WebSocket support
- Health Checks: Automatic instance health monitoring with fallback
- Tor Support: Optional Tor routing plugin for anonymized connections
- Node.js 16+
- SSL certificates (
cert.pemandkey.pemin project root)
# Clone the repository
git clone <repository-url>
cd spaceprox
# Install dependencies
npm install
# Configure your environment
cp .env.release .env
# Edit .env to set your Spacebar instance URLEdit .env:
# Your Spacebar instance
DEFAULT_INSTANCE_URL=http://localhost:3001
# Proxy port
HTTPS_PORT=3002npm startThe proxy will be available at https://localhost:3002
- Navigate to
https://localhost:3002/app - Accept the self-signed certificate warning
- Use Discord's interface - API calls will route to your Spacebar instance
- Open Discord with proxy flags:
discord --proxy-server=https://localhost:3002
Route to different Spacebar instances using:
- Header:
X-Instance-ID: local - Cookie:
spacebar_instance=backup - Query:
https://localhost:3002/app?instance=eu1
Configure instances in instances.json:
{
"instances": [
{
"id": "default",
"name": "Production",
"url": "http://spacebar.example.com:3001",
"enabled": true,
"features": ["api", "gateway", "cdn"]
}
]
}Create custom plugins to modify Discord's interface:
// plugins/my-plugin/index.js
module.exports = {
id: 'my-theme',
name: 'Dark Theme Override',
version: '1.0.0',
init(api) {
api.injectCSS(`
body { background: #0a0a0a !important; }
`);
}
};See plugins/README.md for full API documentation.
| Endpoint | Description |
|---|---|
/_instances |
Instance management API (GET/POST) |
/_plugins/info |
List loaded plugins |
/health |
Health check |
spaceprox/
├── server.js # Main entry point
├── config.js # Configuration loader
├── router.js # Request routing logic
├── proxy-handler.js # HTTP/WebSocket proxy
├── plugin-system.js # Plugin loader and injection
├── instance-manager.js # Multi-instance routing
├── plugins/ # Built-in plugins
├── instances.json # Instance definitions
└── .env # Environment configuration
- This is an independent open-source project. We are not associated with, endorsed by, or affiliated with Discord Inc.
- This proxy is provided as-is, for demonstration and compatibility with open-source backends like Spacebar. Use at your own risk.
- Commercial use is restricted to what is explicitly allowed by proxcord.cc.
- The goal of this project is to support truly open, self-hostable alternatives to centralized chat platforms.
MIT License - see LICENSE file