A work-in-progress SOCKS toolkit for Rust. SOCKS5 (rfc1928) and SOCKS6 (draft-11) are supported.
Example client usage can be found in ./socksx/examples/client.rs. To run the example, use the following command:
cargo run --example client -- --host 172.16.238.4 --port 1080 --dest_host 172.16.238.5 --dest_port 12345 --src_port 12346
Note: The ip addresses are just examples, you should use your own ip addresses. I created a docker network and assigned ip addresses to the containers.
To build the binary, run the following command:
cargo build --release
To run the binary, run the following command:
./target/release/socksx --host 0.0.0.0 --port 1080 --protocol socks5
If you want to using the chaining feature, you can run the following command:
./target/release/socksx --host 0.0.0.0 --port 1080 --protocol socks6 --chain socks6://145.10.0.1:1080
To build the Docker image for the proxy service, use the following command:
(The Dockerfile is located at the root of the repository)
docker build -t proxy:latest -f Dockerfile .
Create a Docker network named net
with a specified subnet.
docker network create --subnet=172.16.238.0/24 net
To run the Docker container, use the following command:
docker run --network=net --ip=172.16.238.2 -p 1080:1080 --name proxy proxy:latest --host 0.0.0.0 --port 1080
Make sure to run these commands in the correct sequence: build the image, create the network, and then run the container.
Check out the docker-compose-proxy.yml
or docker-compose-extensive.yml
file at the root of the repository for an example of how to use the proxy service with Docker Compose.
- make socksx work for macOS
- support chaining in socks 5
- add badge for coverage (coveralls)
- add badge for crates link
- add badge for CI status (github actions)
- add badge for docs.rs and documentation link