{"id":13508735,"url":"https://github.com/surik/tunnerl","last_synced_at":"2025-10-26T11:31:32.838Z","repository":{"id":50344839,"uuid":"13216944","full_name":"surik/tunnerl","owner":"surik","description":"SOCKS4, SOCKS4a and SOCKS5 protocols implementation in Erlang/OTP.","archived":false,"fork":false,"pushed_at":"2023-09-16T15:41:23.000Z","size":49,"stargazers_count":28,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-01-31T18:56:47.907Z","etag":null,"topics":["erlang","erlang-socks-server","proxy","socks4","socks5","sosck4a"],"latest_commit_sha":null,"homepage":"","language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/surik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2013-09-30T14:02:31.000Z","updated_at":"2024-11-08T13:50:06.000Z","dependencies_parsed_at":"2024-01-08T19:22:13.530Z","dependency_job_id":null,"html_url":"https://github.com/surik/tunnerl","commit_stats":{"total_commits":55,"total_committers":2,"mean_commits":27.5,"dds":"0.036363636363636376","last_synced_commit":"48d17c218ae9719b7f3b2404b2ae66bb45df30f8"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/surik%2Ftunnerl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/surik%2Ftunnerl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/surik%2Ftunnerl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/surik%2Ftunnerl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/surik","download_url":"https://codeload.github.com/surik/tunnerl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238319482,"owners_count":19452343,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["erlang","erlang-socks-server","proxy","socks4","socks5","sosck4a"],"created_at":"2024-08-01T02:00:57.700Z","updated_at":"2025-10-26T11:31:27.536Z","avatar_url":"https://github.com/surik.png","language":"Erlang","funding_links":[],"categories":["Networking"],"sub_categories":[],"readme":"# Tunnerl - SOCKS Proxy Implementation in Erlang/OTP\n\n[![Build Status](https://github.com/surik/tunnerl/actions/workflows/ci.yml/badge.svg)](https://github.com/surik/tunnerl/actions/workflows/ci.yml)\n\nTunnerl is a versatile SOCKS4, SOCKS4a, and SOCKS5 proxy protocol implementation in Erlang/OTP. \nIt enables you to create a powerful and flexible proxy server to facilitate secure and efficient communication across various network environments.\n\n### Features\n\n`tunnerl`  offers a range of features for proxying TCP connections, making it a valuable tool for network communication.\nThese features include:\n\n- **SOCKS Protocol Support**:\n  - SOCKS4: A protocol for TCP proxy across firewalls ([socks4.protocol](https://www.openssh.com/txt/socks4.protocol)).\n    - Supports the `connect` command only.\n  - SOCKS 4A: A Simple Extension to SOCKS 4 Protocol ([socks4a.protocol](https://www.openssh.com/txt/socks4a.protocol)).\n  - SOCKS Protocol Version 5 ([RFC1928](https://www.ietf.org/rfc/rfc1928.txt)):\n    - Supports the `connect` command only.\n    - Username/Password Authentication for SOCKS V5 ([RFC1929](https://tools.ietf.org/rfc/rfc1929.txt)).\n    - ATYPs: IPv4, IPv6, and domain.\n\n### Getting Started\n\nFollow these steps to integrate Tunnerl into your Erlang or Elixir application:\n\n1. Add `tunnerl` to your list of dependencies in rebar.config:\n\n```erlang\n{deps, [\n    {tunnerl, \"1.0.0\"}\n]}.\n```\n\n2. Ensure `tunnerl` is started before your application:\n\n```erlang\n{applications, [tunnerl]}.\n```\n\n3. Configure `tunnerl` to use custom handler::\n\n```erlang\n{tunnerl, [\n    {protocols, [socks4, socks5]},\n    {handler, myapp_handler},\n    {acceptors, 10},\n    {ip, {0, 0, 0, 0}},\n    {port, 1080}\n]}.\n```\n\n4. Implement your own `myapp_handler` module. \nThis module defines how `tunnerl` handles authentication and connection requests based on your application's requirements.\n\n```erlang\n-module(myapp_handler).\n\n%% This simple handler module accepts username authentication and\n%% allows user with password \"pass\" do connect command.\n%% Also, is accepts all connections on Socks4 for \"root\".\n\n-export([auth_methods/0,\n         auth/1,\n         handle_command/1]).\n\nauth_methods() -\u003e [username].\n\nauth(#{username := \u003c\u003c\"user\"\u003e\u003e,\n       password := \u003c\u003c\"pass\"\u003e\u003e}) -\u003e\n    accept;\nauth(_) -\u003e reject.\n\nhandle_command(#{protocol := socks4,\n                 command := connect,\n                 username := \u003c\u003c\"root\"\u003e\u003e}) -\u003e\n    accept;\nhandle_command(#{protocol := socks5,\n                 command := connect,\n                 username := \u003c\u003c\"user\"\u003e\u003e}) -\u003e\n    accept;\nhandle_command(_) -\u003e\n    reject.\n```\n\n### Testing\n\nTo test `tunnerl`, follow these steps:\n\n1. Clone the `tunnerl` repository and compile the code:\n\n```\n$ git clone https://github.com/surik/tunnerl.git\n$ cd tunnerl\n$ rebar3 compile\n```\n\n2. Run Tunnerl with a predefined configuration that includes SOCKS4 and SOCKS5 support with no authentication:\n\n```\n$ rebar3 shell --name socks@127.0.0.1 --config tunnerl.config --apps tunnerl\n```\n\n3. You can run a series of common tests to ensure everything is working as expected:\n\n```\n$ rebar3 ct\n```\n\n**Note**: IPv6 tests may not work on all local machines.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsurik%2Ftunnerl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsurik%2Ftunnerl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsurik%2Ftunnerl/lists"}