Skip to content

proxcord/proxclient

Repository files navigation

SpaceProx

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.

Overview

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.

Features

  • 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

Quick Start

Prerequisites

  • Node.js 16+
  • SSL certificates (cert.pem and key.pem in project root)

Installation

# 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 URL

Configuration

Edit .env:

# Your Spacebar instance
DEFAULT_INSTANCE_URL=http://localhost:3001

# Proxy port
HTTPS_PORT=3002

Running

npm start

The proxy will be available at https://localhost:3002

Usage

Browser Setup

  1. Navigate to https://localhost:3002/app
  2. Accept the self-signed certificate warning
  3. Use Discord's interface - API calls will route to your Spacebar instance

Discord Desktop App

  1. Open Discord with proxy flags:
    discord --proxy-server=https://localhost:3002

Multi-Instance Routing

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"]
    }
  ]
}

Plugin Development

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.

API Endpoints

Endpoint Description
/_instances Instance management API (GET/POST)
/_plugins/info List loaded plugins
/health Health check

Project Structure

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

Important Disclaimers

  • 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.

License

MIT License - see LICENSE file

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors