Git Product home page Git Product logo

socks5-proxy-server's Introduction

socks5-proxy-server

This Perl code implements a SOCKS5 proxy server that listens for incoming connections and processes them in separate threads. The server takes four input parameters: host, port, login, and password.

When a client attempts to connect to the server, the server checks if the client supports any of the available authentication methods (no authentication or login/password authentication). If a suitable method is found, the server establishes a connection with the target server and begins forwarding data between the client and the target server.

The code uses the IO::Select module for working with sockets and the threads module for creating and managing threads. It includes several functions, including:

  • main: the main function that creates threads for processing incoming connections.
  • replenish: a function that creates additional threads if the number of free threads is less than the specified value.
  • new_client: a function that handles incoming client connections and checks if the available authentication methods are supported by the client.
  • socks_auth: a function that performs login and password authentication.
  • handle_client: a function that establishes a connection with the target server and forwards data between the client and the target server.

This code includes the use of the following Perl modules: IO::Select, Socket, threads, threads::shared.

To run this code, enter the following command: perl socks5.pl host port login password

Note that this code is designed for educational purposes and should not be used in production environments without proper modifications and security measures. ๐Ÿ˜Š

This code is distributed under the MIT License, which allows for free use, modification, and distribution of the code as long as the original copyright notice and license are included.

socks5-proxy-server's People

Contributors

kaimi- avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.