{"id":42927542,"url":"https://github.com/niklata/muonsocks","last_synced_at":"2026-01-30T18:31:04.203Z","repository":{"id":80315466,"uuid":"451303004","full_name":"niklata/muonsocks","owner":"niklata","description":"SOCKS5 and SOCKS4a proxy server","archived":false,"fork":false,"pushed_at":"2024-06-27T22:29:25.000Z","size":333,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-06-28T00:47:00.048Z","etag":null,"topics":["linux","proxy","socks","socks-proxy","socks-server","socks4","socks4-proxy","socks4-server","socks4a","socks5","socks5-proxy","socks5-server"],"latest_commit_sha":null,"homepage":"","language":"C","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/niklata.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-24T03:27:25.000Z","updated_at":"2024-06-04T01:51:58.000Z","dependencies_parsed_at":"2024-02-01T19:10:46.412Z","dependency_job_id":"a4ceecd1-39a3-4639-bd3a-9751dccbb442","html_url":"https://github.com/niklata/muonsocks","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/niklata/muonsocks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklata%2Fmuonsocks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklata%2Fmuonsocks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklata%2Fmuonsocks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklata%2Fmuonsocks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/niklata","download_url":"https://codeload.github.com/niklata/muonsocks/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklata%2Fmuonsocks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28917040,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T16:37:38.804Z","status":"ssl_error","status_checked_at":"2026-01-30T16:37:37.878Z","response_time":66,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["linux","proxy","socks","socks-proxy","socks-server","socks4","socks4-proxy","socks4-server","socks4a","socks5","socks5-proxy","socks5-server"],"created_at":"2026-01-30T18:31:02.269Z","updated_at":"2026-01-30T18:31:04.191Z","avatar_url":"https://github.com/niklata.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# muonsocks\n\n## Introduction\n\nThis is an enhancement of rofl0r's excellent\n[microsocks](https://github.com/rofl0r/microsocks) program with the following\nchanges:\n\n* Support SOCKS4a clients\n* Support disabling outgoing ipv4 or ipv6\n* Support changing uid and chroot\n* Support binding to multiple ip/port tuples\n* Rewritten SOCKS5 parser that tolerates inputs split across multiple recv()\n* More performance from larger buffers and fewer poll invocations\n* Use TCP_NODELAY to lower latency impact\n* Use lock-free list rather than dynamic array for threads\n* Minimal memory allocations after init, and low heap fragmentation\n* Enhanced error handling\n\nmuonsocks fully supports SOCKS5 and SOCKS4a TCP proxying as a server.\n\nIt inherits the good design from microsocks, so the only real limits\nare set by the available RAM and file descriptor limits.  OOM does not\ncause termination, and explicit memory allocation and heap\nfragmentation are minimized.\n\nIt is ~1000 LoC compared to microsocks's ~600 LoC, so it is not\nas minimal, but it is still a very small program (~27KiB dynamically\nlinked to glibc on amd64).\n\n## Requirements\n\n* Linux or BSD system\n* GCC or Clang\n* GNU Make\n\n## Standard Usage\n\nCompile and install muonsocks.\n* Build muonsocks: `make`\n* Install the `muonsocks` executable in a normal place.  I suggest\n  `/usr/local/bin`.\n\nSet up the user account and chroot directory for muonsocks.  Example:\n```\n$ su -\n# umask 077\n# groupadd muonsocks\n# useradd -d /var/empty -s /sbin/nologin -g muonsocks muonsocks\n```\n\nThen the program can be run similarly to:\n\n`# muonsocks -u muonsocks -C /var/empty -4 -i 192.168.0.1 -i 10.0.0.1 -p 1080`\n\nWhich would run a SOCKS5 server listening for requests on 192.168.0.1:1080 and\n10.0.0.1:1080 that would only send outgoing IPv4 requests.\n\nI suggest running muonsocks from a process supervisor such as\n[s6](http://www.skarnet.org/software/s6).  This will allow for reliable\nfunctioning in the case of unforseen or unrecoverable errors.\n\nFor full information on command line options, run:\n\n`$ muonsocks -?`\n\n## History / Rationale\n\nI previously used a SOCKS server that I wrote called nsocks.  It used an\nevent-driven model that attempted to use Linux's splice() to reduce\nkernel-\u003euserspace-\u003ekernel copies.  However, the event-driven model\nworks better for pure servers such as HTTP than for proxies; buffering\nis challenging to properly control in all cases for an event-driven\nproxy, but is natural with threads and careful use of blocking writes.\nsplice() also gave marginal performance gains but made the program\nsignificantly more complex.\n\nI ended up using the original microsocks when I became tired of trying\nto fix the many corner-cases in nsocks, and I expected to only use\nit temporarily; there were some features I needed, which I added,\nand I ported over some parts of nsocks that were well-tested such\nas the SOCKS4 support.  Since nsocks was written in C++, I simply\nused C++ rather than porting my own code to C.\n\nAfter relatively little work, my local version of microsocks (which I\nended up calling muonsocks) worked trouble-free, and I ended up with\nno motivation to write another server.  A few years later, I ended up\nporting back to C and making further improvements.\n\n## Downloads\n\n* [GitLab](https://gitlab.com/niklata/muonsocks)\n* [Codeberg](https://codeberg.org/niklata/muonsocks)\n* [BitBucket](https://bitbucket.com/niklata/muonsocks)\n* [GitHub](https://github.com/niklata/muonsocks)\n\n## Original microsocks README below\n\nMicroSocks - multithreaded, small, efficient SOCKS5 server.\n===========================================================\n\na SOCKS5 service that you can run on your remote boxes to tunnel connections\nthrough them, if for some reason SSH doesn't cut it for you.\n\nIt's very lightweight, and very light on resources too:\n\nfor every client, a thread with a stack size of 8KB is spawned.\nthe main process basically doesn't consume any resources at all.\n\nthe only limits are the amount of file descriptors and the RAM.\n\nIt's also designed to be robust: it handles resource exhaustion\ngracefully by simply denying new connections, instead of calling abort()\nas most other programs do these days.\n\nanother plus is ease-of-use: no config file necessary, everything can be\ndone from the command line and doesn't even need any parameters for quick\nsetup.\n\nHistory\n-------\n\nThis is the successor of \"rocksocks5\", and it was written with\ndifferent goals in mind:\n\n- prefer usage of standard libc functions over homegrown ones\n- no artificial limits\n- do not aim for minimal binary size, but for minimal source code size,\n  and maximal readability, reusability, and extensibility.\n\nas a result of that, ipv4, dns, and ipv6 is supported out of the box\nand can use the same code, while rocksocks5 has several compile time\ndefines to bring down the size of the resulting binary to extreme values\nlike 10 KB static linked when only ipv4 support is enabled.\n\nstill, if optimized for size, *this* program when static linked against musl\nlibc is not even 50 KB. that's easily usable even on the cheapest routers.\n\ncommand line options\n------------------------\n\n    muonsocks -1 -i listenip -p port -U user -P password -b bindaddr\n\nall arguments are optional.\nby default listenip is 0.0.0.0 and port 1080.\n\noption -1 activates auth_once mode: once a specific ip address\nauthed successfully with user/pass, it is added to a whitelist\nand may use the proxy without auth.\nthis is handy for programs like firefox that don't support\nuser/pass auth. for it to work you'd basically make one connection\nwith another program that supports it, and then you can use firefox too.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniklata%2Fmuonsocks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniklata%2Fmuonsocks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniklata%2Fmuonsocks/lists"}