This is an implementation of the SOCKS v5 server in the OpenResty
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib/resty/socks5
t
.gitattributes
.gitignore
LICENSE
Makefile
README.md
dist.ini
valgrind.suppress

README.md

Name

lua-resty-socks5-server

This is an implementation of the SOCKS v5 RFC1928 server in the OpenResty and It's based on the stream-lua-ningx-module under the hood.

Table of Contents

Status

Experimental (works well on personal server)

Usage

Make sure your stream_lua_nginx's cosocket support the API tcpsock:receive('*b'), we are rely on it to implementation full duplex between upstream and downstream.

    server {
        listen 1234;

        content_by_lua_block {
                local socks5_server = require "lib.resty.socks5.server"

                socks5_server.run(3000)
                -- or if you want to enable authentication
                -- socks5_server.run(3000, "username", "password")
        }
    }

API

run

syntax: module.run(timeout[,username, password])

run a socks5 server.

  • timeout The socket timeout (default 1000 ms) include connect、read、write between upstream and downstream.

  • username The socks5 authentication username.

  • password The socks5 authentication username.

Contributing

To contribute to lua-resty-socks5-server, clone this repo locally and commit your code on a separate branch.

PS: PR Welcome 🚀 🚀 🚀 🚀

Author

GitHub @detailyang

License

lua-resty-socks5-server is licensed under the MIT license.