Giter Site home page Giter Site logo

socks2http's Introduction

SOCKS2HTTP

This project is a SOCKS5 to HTTP proxy server written in Rust. It allows clients to connect to the internet through an HTTP proxy server using SOCKS5 protocol.

Features

  • SOCKS5 server with user/password authentication (always succeeds - see note below)
  • Forwards traffic to a configured HTTP proxy server
  • Logs connection details and timings (connection establishment, authentication, data transfer)

Note: Currently, authentication on the SOCKS5 server always succeeds. This is to make forwarding credentials to HTTP proxy possible.

Usage

Requirements:

Building:

  1. Clone the repository:
    git clone https://github.com/1zun4/socks2http.git
  2. Navigate to the project directory:
    cd socks2http
  3. Build the project:
    cargo build

Running:

  1. Run the server:
    cargo run

Client Usage:

You can use any SOCKS5 client to connect to the server. Here's an example using curl:

curl -x socks5://127.0.0.1:42000 -U "username_of_http:password_of_http" https://ipinfo.io/json

This command will connect to https://ipinfo.io/json through the SOCKS5 server running on localhost:42000, using the provided username and password for HTTP proxy authentication.

Configuration

  • The SOCKS5 server listens on 127.0.0.1:42000 by default. You can change this by modifying the PROXY_SOCKS5_ADDR constant in the source code.
  • The HTTP proxy server address is configured in the PROXY_HTTP_ADDR constant. You need to replace it with the actual address of your HTTP proxy server.

Logging

The project uses the env_logger crate for logging. You can adjust the verbosity level by setting the RUST_LOG environment variable before running the server. For example:

RUST_LOG=info cargo run

This will only log informational messages.

Contributing

We welcome contributions to this project! Please use common sense when contributing.

License

This project is licensed under the GNU General Public License v3.0. A copy of the license is available in the LICENSE: LICENSE file.

socks2http's People

Contributors

1zun4 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.