Skip to main content

Fast, lightweight protocol translation hub.

Project description

protoproxy

Fast, lightweight protocol translation hub. Normalizes any supported protocol into a canonical format and re-serializes it out.


Overview

protoproxy sits between a reverse proxy and one or more backend services. Incoming requests — regardless of source protocol — are normalized into a shared canonical Python dict. From there, protoproxy routes and re-serializes into whatever protocol the target backend speaks.

New protocols are two files: an input module that normalizes into the canonical dict, and an output module that translates back out. The core stays untouched.

Currently supports HTTPS and MCP.

                                     +------------------------------------+
                                     |             protoproxy             |
                                     |                                    |
               +----------+          |  +----------+     +-------------+  |
 Internet <--> |  Nginx   | <------> |  |  https   |     |  Canonical  |  |
  (HTTPS)      |  :443    |          |  |  input/  |<--->|    dict     |  |
               |Rate limit|          |  |  output  |     |             |  |
               |  Bearer  |          |  +----------+     +-------------+  |
               |  token   |          |                          ^         |
               +----------+          |                          |         |
                                     |                          v         |
                                     |                   +-------------+  |
                                     |                   |     mcp     |  |
                                     |                   |   input/    |  |
                                     |                   |   output    |  |
                                     |                   +-------------+  |
                                     |                          |         |
                                     +--------------------------+---------+
                                                                |
                                                                v
                                                        +---------------+
                                                        |  MCP Server   |
                                                        |    :8026      |
                                                        +---------------+

protoproxy doesn't replace your reverse proxy — it complements it. Nginx handles TLS termination, rate limiting, and bearer token or API key authentication. Only clean, authorized traffic reaches protoproxy.


How It Works

  1. Reverse proxy receives public HTTPS traffic, enforces rate limits and auth, and forwards clean requests to protoproxy
  2. main.py receives the forwarded request and checks config.json to determine the source protocol and target backend
  3. https_input.py breaks down the incoming request into a canonical Python dict — a neutral intermediate format every module understands
  4. main.py checks config.json for the target port and protocol, then calls the matching output module
  5. mcp_output.py translates the canonical dict into the target protocol and forwards it to the backend service
  6. The response travels back through the same chain in reverse — backend → output module → canonical dict → input module → reverse proxy → client

Configuration

protoproxy is configured via config.json. Secrets (tokens, keys) go in .env and are never committed.

{
    "PROTOPROXY_HOST": "127.0.0.1",
    "PROTOPROXY_PORT": 8008,
    "LOG_LEVEL": "info",

    "PROXY_HOST": "127.0.0.1",
    "PROXY_PORT": 8008,

    "OUTPUTS": {
        "mcp": {
            "host": "127.0.0.1",
            "port": 8026
        }
    }
}
Key Type Description
PROTOPROXY_HOST str Interface protoproxy binds to
PROTOPROXY_PORT int Port protoproxy listens on (default 8008)
LOG_LEVEL str debug, info, warning, error
PROXY_HOST str Host of your reverse proxy
PROXY_PORT int Port your reverse proxy forwards to protoproxy
OUTPUTS dict Protocol name → host and port of backend service

Installation

pip install protoproxy

Or from source:

git clone https://github.com/YOUR_USERNAME/protoproxy.git
cd protoproxy
pip install -e .

Quick Start

python -m protoproxy

protoproxy will start on 127.0.0.1:8008 by default and load config.json from the working directory.


Supported Protocols

| HTTPS | | MCP |


Contributing

Issues and PRs welcome. To add a new protocol, open an issue first to discuss the canonical dict contract before writing code.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

protoproxy-0.0.3.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

protoproxy-0.0.3-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file protoproxy-0.0.3.tar.gz.

File metadata

  • Download URL: protoproxy-0.0.3.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for protoproxy-0.0.3.tar.gz
Algorithm Hash digest
SHA256 1a36e9b4beda38ffec67c8b4f14626ac13c6ac597225f865465eb539a0da083f
MD5 ecd5878cc50a2f9fcd762e8279f137fc
BLAKE2b-256 eb48450b4a592c17b9855fe54910e702475931b2cd7e504cc72bf0c037edb6ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for protoproxy-0.0.3.tar.gz:

Publisher: publish.yml on geomux/protoproxy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file protoproxy-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: protoproxy-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for protoproxy-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7c6e485850227914b4a2ed96914ed906d809259628dfa484d9b0fefc487cc560
MD5 ae83e1657542f3263c03ea4b1d883070
BLAKE2b-256 30fa8b4da9d15f1145fc62a474d099c417671a9163c38b6df69a423213f5b9fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for protoproxy-0.0.3-py3-none-any.whl:

Publisher: publish.yml on geomux/protoproxy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page