revenkroz / http-to-socks5-proxy

Tiny proxy server (~5Mb) to redirect http traffic to target host through proxy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HTTP to SOCKS tiny proxy server

The idea is to have a proxy server that can be used to tunnel HTTP traffic to some server through a proxy (e.g. socks5 or http proxy). This is useful when you want to use a reverse proxy service to route traffic to a specific host without changing the client code (except base url).

Usage

Note: For all examples below we assume that the proxy server is socks5 proxy and the target server is https://api.example.com with authentication.

Executable usage

Add environment variables:

PROXY_DSN='socks5://test1:test2@123.123.123.123:25000'
TARGET_HOST=https://api.example.com
DEFAULT_HEADERS='Authorization: Bearer test'
IGNORE_SSL=true

Run.

./app

Docker compose usage

version: '3.9'

services:
  api_example_com_proxy:
    image: ghcr.io/revenkroz/http-to-socks5-proxy:main
    container_name: proxy
    environment:
      PROXY_DSN: 'socks5://test1:test2@123.123.123.123:25000'
      TARGET_HOST: https://api.example.com
      DEFAULT_HEADERS: 'Authorization: Bearer test'
      IGNORE_SSL: true
    ports:
        - "8080:8080"

About

Tiny proxy server (~5Mb) to redirect http traffic to target host through proxy

License:MIT License


Languages

Language:Go 88.6%Language:Dockerfile 11.4%