Skip to content

Latest commit

 

History

History
130 lines (84 loc) · 2.9 KB

File metadata and controls

130 lines (84 loc) · 2.9 KB

Docker Setup for Reverse-SOXY

This document provides instructions for running Reverse-SOXY in Docker containers.

Prerequisites

Building the Docker Image

To build the Docker image:

docker build -t reverse-soxy .

Running with Docker

Proxy Mode

docker run -p 1080:1080 -p 9000:9000 reverse-soxy --proxy-listen-addr 0.0.0.0:1080 --tunnel-listen-port 9000 --secret yourSecretHere

Agent Mode

docker run reverse-soxy --tunnel-addr proxy.host:9000 --secret yourSecretHere

Relay Mode

docker run -p 9000:9000 reverse-soxy --mode relay --relay-listen-port 9000 --secret yourSecretHere

Proxy via Relay Mode

docker run -p 1080:1080 reverse-soxy --mode proxy --register --relay-addr relay.host:9000 --proxy-listen-addr 0.0.0.0:1080 --secret yourSecretHere

Agent via Relay Mode

docker run reverse-soxy --mode agent --relay-addr relay.host:9000 --secret yourSecretHere

Running with Docker Compose

The included docker-compose.yml file provides configurations for all modes of operation.

Setting a Secure Secret

Before running, set a secure secret:

export SECRET=yourSecretHere

Running Different Setups

Direct Proxy and Agent

# Start the proxy
docker-compose up proxy

# In another terminal, start the agent
docker-compose up agent

Relay Server with Proxy and Agent

# Start the relay server
docker-compose up relay

# In another terminal, start the proxy via relay
docker-compose up proxy-via-relay

# In another terminal, start the agent via relay
docker-compose up agent-via-relay

Configuration

Environment Variables

  • SECRET: The shared secret for encryption/authentication
  • PROXY_HOST: The hostname of the proxy (for agent mode)
  • RELAY_HOST: The hostname of the relay server (for proxy-via-relay and agent-via-relay modes)

Custom Configuration File

You can mount a custom YAML configuration file:

docker run -v /path/to/your/config.yml:/app/config/config.yml reverse-soxy --config /app/config/config.yml --secret yourSecretHere

Security Considerations

  • Always use a strong, unique secret for each deployment
  • Consider using Docker secrets or environment variables for the secret in production
  • The default configuration exposes ports to all interfaces (0.0.0.0) within the container, so be careful with port mappings
  • In production, consider using a non-root user in the container

Troubleshooting

Debugging

Add the --debug flag to enable debug logging:

docker run reverse-soxy --secret yourSecretHere --debug

Checking Container Logs

docker logs <container_id>

Inspecting a Running Container

docker exec -it <container_id> /bin/sh