Skip to content

Lightweight implementation of a SOCKS5 proxy built on async Rust

Notifications You must be signed in to change notification settings

boris-sinyapkin/lurk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lurk

Build & Test

Overview

Lurk is an async and lightweight implementation of a SOCKS5 proxy, allowing users to establish the connection through intermediate data relaying server. It's entirely built in Rust with tokio-async runtime.

Getting Started

Prerequisites

Run Docker container

Lurk proxy could be deployed by using docker image stored in GitHub Package's.

Publish port to default 1080 and start listening incoming connections:

Run latest release in the Docker container:

docker run --rm --name lurk -p 1080:1080/tcp ghcr.io/boris-sinyapkin/lurk:latest

Run latest nightly build in the Docker container:

docker run --rm --name lurk-nightly -p 1080:1080/tcp ghcr.io/boris-sinyapkin/lurk-nightly:latest

Build & deploy from GitHub sources

Project could be compiled directly from sources:

git clone git@github.com:boris-sinyapkin/lurk.git
cd lurk
cargo build --release 

If you want to install binary to the /bin directory, run the following command from cloned repository:

cargo install --path .

By default, Lurk is listening on conventionally defined 1080 port (see RFC 1928):

Fast and fancy SOCKS5 proxy

Usage: lurk [OPTIONS]

Options:
  -p, --port <PORT>  TCP port to listen on [default: 1080]
  -i, --ipv4 <IPV4>  IPv4 to listen on [default: 127.0.0.1]
  -h, --help         Print help
  -V, --version      Print version

If default settings is acceptable, execute installed binary:

lurk

Either deploy server through cargo:

cargo run --release

Run benchmark tool against Lurk

Lurk server can be stressed by some HTTP benchmark, e.g. rsb project.

Below bash script will deploy proxy server and stress it by running this benchmark tool. As rsb project uses request create, it's possible to test proxied connections.

# Create bridge docker network
docker network create lurk-network

# Run Lurk in docker container and attach it to created bridge lurk-network
docker run --rm --network lurk-network --name lurk-server -p 1080:1080/tcp ghcr.io/boris-sinyapkin/lurk:latest

Wait until it deploys and run benchmark in a separate shell:

# Run benchmark with 1000 HTTP GET requests perfomed over 100 connections
docker run --rm --network lurk-network --name rsb-benchmark -e http_proxy=socks5://lurk-server:1080 \
  ghcr.io/gamelife1314/rsb:latest --requests 1000 --connections 100 -l --timeout 5 http://example.com

# Clean-up
docker kill lurk-server
docker network rm lurk-network