2017 © Pedro PelĂĄez
 

project psocksd

The SOCKS tunnel / proxy server daemon written in PHP

image

clue/psocksd

The SOCKS tunnel / proxy server daemon written in PHP

  • Monday, November 7, 2016
  • by clue
  • Repository
  • 6 Watchers
  • 44 Stars
  • 153 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 11 Forks
  • 1 Open issues
  • 10 Versions
  • 1 % Grown

The README.md

psocksd

The SOCKS tunnel / proxy server daemon written in PHP, (*1)

Features

The SOCKS protocol family can be used to easily tunnel TCP connections independent of the actual application level protocol, such as HTTP, SMTP, IMAP, Telnet, etc. In this mode, a SOCKS server acts as a generic proxy allowing higher level application protocols to work through it., (*2)

  • SOCKS proxy server with support for SOCKS4, SOCKS4a and SOCKS5 protocol versions (all at the same time)
  • Optionally require username / password authentication (SOCKS5 only)
  • Zero configuration, easy to use command line interface (CLI) to change settings without restarting server
  • Incoming SOCKS requests can be forwarded to another SOCKS server to act as a tunnel gateway, perform transparent protocol translation or add SOCKS authentication for clients not capable of doing it themselves.
    • Tunnel endpoint can be changed during runtime (via CLI command).
    • Particularly useful when used as an intermediary server and using ever-changing public SOCKS tunnel end points.
  • Using an async event-loop, it is capable of handling multiple concurrent connections in a non-blocking fashion
  • Built upon the shoulders of reactphp/react and clue/socks, it uses well-tested dependencies instead of reinventing the wheel.

Usage

Once installed, you can start psocksd and listen for incoming SOCKS connections by running:, (*3)

$ php psocksd.phar

Using this command, psocksd will start listening on the default adress localhost:9050., (*4)

Listen address

If you want to listen on another address, you can supply an explicit listen address like this:, (*5)

# start SOCKS daemon on port 9051 instead
$ php psocksd.phar 9051

# explicitly listen on the given interface
$ php psocksd.phar 192.168.1.2:9050

# listen on all interfaces (allow access to SOCKS server from the outside)
$ php psocksd.phar *:9050

# explicitly only support SOCKS5 and reject other protocol versions
$ php psocksd.phar socks5://localhost:9050

# require client to send the given authentication information
$ php psocksd.phar socks5://username:password@localhost:9051

Interactive CLI

By default, psocksd will run an interactive command line interface. This means that it keeps running in the foreground and accepts commands from STDIN., (*6)

You can pass the --no-interaction argument to disable this interactive mode so that it does not accept any commands from STDIN. The interactive mode is always disabled on Windows, because it's impossible to read from STDIN without blocking the whole daemon., (*7)

You can run the help command in order to see all available commands and their usage:, (*8)

> help
psocksd help:
[
]

You can run the ping command in order to test creating a TCP/IP connection through the given SOCKS server:, (*9)

> ping 192.168.1.200:1080
ping www.google.com:80
ping test OK (⌚ 0.378s)

You can run the exit or quit command (or hit CTRL+D or CTRL-C) in order to exit the program:, (*10)

> exit
exiting...

Client configuration

Once psocksd is started, it accepts incoming SOCKS client connections. Therefor, you have to configure your client program (webbrowser, email client etc.) to actually use the SOCKS server., (*11)

The exact configuration depends on your program, but quite a few programs allow you to use a SOCKS proxy. So depending on the above list address, supply the following information:, (*12)

Proxy-Type: SOCKS4 or SOCKS5
Socks-Host: localhost
Socks-Port: 9050

Install

You can grab a copy of clue/psocksd in either of the following ways., (*13)

You can simply download a pre-compiled and ready-to-use version as a Phar to any directory. Simply download the latest psocksd.phar file from our releases page:, (*14)

Latest release, (*15)

That's it already. You can now verify everything works by running this:, (*16)

$ cd ~/Downloads
$ php psocksd.phar

If you prefer a global (system-wide) installation without having to type the .phar extension each time, you may invoke:, (*17)

$ chmod 0755 psocksd.phar
  $ sudo mv psocksd.phar /usr/local/bin/psocksd
  

You can verify everything works by running:, (*18)

$ psocksd
  

Updating phar

There's no separate update procedure, simply overwrite the existing phar with the new version downloaded., (*19)

Manual Installation from Source

The manual way to install psocksd is to clone (or download) this repository and use composer to download its dependencies. Obviously, for this to work, you'll need PHP, git and curl installed:, (*20)

$ sudo apt-get install php5-cli git curl
$ git clone https://github.com/clue/psocksd.git
$ curl -s https://getcomposer.org/installer | php
$ php composer.phar install

If you want to build the above mentioned psocksd.phar yourself, you have to install clue/phar-composer and can simply invoke:, (*21)

$ php phar-composer.phar build ~/workspace/psocksd
  

Updating manually

If you have followed the above install instructions, you can update psocksd by issuing the following two commands:, (*22)

$ git pull
$ php composer.phar install

Docker

This project is also available as a docker image. Using the clue/psocksd image is as easy as running this:, (*23)

$ docker run -d -p 9050:9050 clue/psocksd

License

MIT-licensed, (*24)

The Versions

21/03 2016
22/10 2014

v0.3.4

0.3.4.0 https://github.com/clue/psocksd

Extensible SOCKS tunnel / proxy server daemon

  Sources   Download

MIT

The Requires

 

by Christian LĂŒck

tcp tunnel socks proxy proxy server server daemon

28/09 2014

v0.3.3

0.3.3.0 https://github.com/clue/psocksd

Extensible SOCKS tunnel / proxy server daemon

  Sources   Download

MIT

The Requires

 

by Christian LĂŒck

tcp tunnel socks proxy proxy server server daemon

05/04 2014

v0.3.2

0.3.2.0 https://github.com/clue/psocksd

Extensible SOCKS tunnel / proxy server daemon

  Sources   Download

MIT

The Requires

 

by Christian LĂŒck

tcp tunnel socks proxy proxy server server daemon

24/06 2013

v0.3.1

0.3.1.0 https://github.com/clue/psocksd

Extensible SOCKS tunnel / proxy server daemon

  Sources   Download

MIT

The Requires

 

tcp tunnel socks proxy proxy server server daemon

24/06 2013

v0.3.0

0.3.0.0 https://github.com/clue/psocksd

Extensible SOCKS tunnel / proxy server daemon

  Sources   Download

MIT

The Requires

 

tcp tunnel socks proxy proxy server server daemon

11/06 2013

v0.2.0

0.2.0.0 https://github.com/clue/psocksd

Extensible SOCKS tunnel / proxy server daemon

  Sources   Download

MIT

The Requires

 

tcp tunnel socks proxy proxy server server daemon

23/12 2012