{"id":13775835,"url":"https://github.com/oyyd/encryptsocks","last_synced_at":"2025-04-14T22:37:22.620Z","repository":{"id":80920097,"uuid":"58639465","full_name":"oyyd/encryptsocks","owner":"oyyd","description":"Encrypt your socks transmission.","archived":false,"fork":false,"pushed_at":"2017-12-17T14:00:55.000Z","size":400,"stargazers_count":140,"open_issues_count":10,"forks_count":20,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-28T10:50:20.431Z","etag":null,"topics":["gfwlist","nodejs","pac","shadowsocks","socks","socks5"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oyyd.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2016-05-12T12:28:25.000Z","updated_at":"2024-11-18T23:55:39.000Z","dependencies_parsed_at":"2023-02-28T22:15:49.439Z","dependency_job_id":null,"html_url":"https://github.com/oyyd/encryptsocks","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oyyd%2Fencryptsocks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oyyd%2Fencryptsocks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oyyd%2Fencryptsocks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oyyd%2Fencryptsocks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oyyd","download_url":"https://codeload.github.com/oyyd/encryptsocks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248974722,"owners_count":21192187,"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":["gfwlist","nodejs","pac","shadowsocks","socks","socks5"],"created_at":"2024-08-03T17:01:52.039Z","updated_at":"2025-04-14T22:37:22.600Z","avatar_url":"https://github.com/oyyd.png","language":"JavaScript","funding_links":[],"categories":["\u003ca id=\"d03d494700077f6a65092985c06bf8e8\"\u003e\u003c/a\u003e工具"],"sub_categories":["\u003ca id=\"57b8e953d394bbed52df2a6976d98dfa\"\u003e\u003c/a\u003eSocks"],"readme":"# encryptsocks\n\n[![npm-version](https://img.shields.io/npm/v/encryptsocks.svg?style=flat-square)](https://www.npmjs.com/package/encryptsocks)\n[![Build Status](https://travis-ci.org/oyyd/encryptsocks.svg?branch=master)](https://travis-ci.org/oyyd/encryptsocks)\n\nEncrypt your socks transmission.\n\n* [Why another Nodejs implementation? (with Benchmark)](https://github.com/oyyd/encryptsocks#why-another-nodejs-implementation)\n* [CLI](https://github.com/oyyd/encryptsocks#cli)\n* [Examples](https://github.com/oyyd/encryptsocks#examples)\n* [Config](https://github.com/oyyd/encryptsocks#config)\n* [SOCKS5 Username Password Authetication](https://github.com/oyyd/encryptsocks#socks5-username-password-authetication)\n\n## Why another Nodejs implementation?\n\n__Nodejs is a very good choice to achieve both flexibility and good performance in this situation__.\n\nAnd I have found that many of who are familiar with the [original implementation](https://github.com/shadowsocks/shadowsocks-nodejs) may be curious about the memory usage so that I have finished some simple benchmarks to measure its behavior.\n\n### Benchmark\n\nYou can get the benchmark details [here](benchmark/README.md) or even test your own  implementation.\n\nAfter some simple benchmarks that compare both the node and python implementation, my conclusion is:\n\n1. Node has a different GC strategy but it's, of course, able to keep thousands of connections with a reasonable memory usage. [It's not a bug, it's a conscious time/space trade-off](https://github.com/nodejs/node-v0.x-archive/issues/4525).\n\n2. Each request would cost less time to get responsed (even 50% less time in some situations).\n\n3. Node implementation is less likely to fail requests in high concurrency situation.\n\nAnd the higher concurrency benchmarks may be meaningless as the bandwidth and network environment would become the actual bottleneck in the real world.\n\n**Do Please** point out my faults if I have missed something or get something wrong.\n\n## Requirement\n\nnode \u003e= v4\n\nIt's recommended to use node v6 to achieve better performance.\n\n## Installation\n\n```\nnpm i -g encryptsocks\n```\n\n## About the daemon\n\nEncryptsocks use `pm2` as the watcher process from `1.4.0`.\n\n## CLI\n\nUse `localssjs` (local ssjs) to start clients to communicate with applications. The `localssjs` server will also serve a [pac](https://en.wikipedia.org/wiki/PAC) file at `http://127.0.0.1:8090` (by default) for your apps to avoid unnecessary tunnel work.\n\nYou may prefer to navigate [clients page](https://shadowsocks.org/en/download/clients.html) and choose clients for your devices instead of using `localssjs`.\n\nUse `serverssjs` (server ssjs) to start your remote server.\n\nUse `localssjs -h` or `serverssjs -h` to show cli options:\n\n```\nProxy options:\n  -c config                     path to config file\n  -s SERVER_ADDR                server address, default: 127.0.0.1\n  -p SERVER_PORT                server port, default: 8083\n  -l LOCAL_ADDR                 local binding address, default: 127.0.0.1\n  -b LOCAL_PORT                 local port, default: 1080\n  -k PASSWORD                   password\n  -m METHOD                     encryption method, default: aes-128-cfb\n  -t TIMEOUT                    timeout in seconds, default: 600\n  --pac_port PAC_PORT           PAC file server port, default: 8090\n  --pac_update_gfwlist [URL]    [localssjs] Update the gfwlist\n                                for PAC server. You can specify the\n                                request URL.\n  --level LOG_LEVEL             log level, default: warn\n                                example: --level verbose\nGeneral options:\n  -h, --help                    show this help message and exit\n  -d start/stop/restart         daemon mode\n```\n\n### Examples\n\nStart clients that bind at `1088` and will connect to `MY.SSSERVER.DOMAIN`:\n\n```\n$ localssjs -b 1088 -s MY.SSSERVER.DOMAIN\n```\n\nStart daemon:\n\n```\n$ localssjs -d start -b 1080\n```\n\nLog verbosely:\n\n```\n$ serverssjs -d start --level verbose\n```\n\nUpdate GFWList for your .pac file server:\n\n```\n$ localssjs --pac_update_gfwlist\n```\n\nUpdate GFWList for your .pac file server from a specific URL (default [url](https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt)):\n\n```\n$ localssjs --pac_update_gfwlist http://firefoxfan.cc/gfwlist/gfwlist.txt\n```\n\n## Config\n\n```json\n{\n  \"serverAddr\": \"127.0.0.1\",\n  \"serverPort\": 8083,\n  \"localAddr\": \"127.0.0.1\",\n  \"localPort\": 1080,\n  \"pacServerPort\": 8090,\n  \"password\": \"YOUR_PASSWORD_HERE\",\n  \"timeout\": 600,\n  \"method\": \"aes-128-cfb\",\n\n  \"level\": \"warn\",\n  \"localAddrIPv6\": \"::1\",\n  \"serverAddrIPv6\": \"::1\"\n}\n```\n\nSpecify your config file with `-c` flag:\n\n```\n$ serverssjs -c config.json\n```\n\nYou can change default config in `config.json` file of your global\npackage.\n\n## SOCKS5 Username Password Authetication\n\n__NOTE:__ This authetication is dangerous when sniffed.\n\nAdd `auth` property to your `config.json` and make `forceAuth` `true`.\n\n```json\n{\n  \"auth\": {\n    \"forceAuth\": true,\n    \"usernamePassword\": {\n      \"name\": \"password\"\n    }\n  }\n}\n```\n\n## [Optimizing](https://github.com/Long-live-shadowsocks/shadowsocks/wiki/Optimizing-Shadowsocks)\n\n## Encryption methods\n\n* aes-128-cfb\n* aes-192-cfb\n* aes-256-cfb\n* bf-cfb\n* camellia-128-cfb\n* camellia-192-cfb\n* camellia-256-cfb\n* cast5-cfb\n* des-cfb\n* idea-cfb\n* rc2-cfb\n* rc4\n* rc4-md5\n* seed-cfb\n\n## Test\n\n```\n$ npm test\n```\n\n## Contribute\n\n```\n$ npm run watch\n```\n\n## About the support to UDP relay\n\nI intend to implement UDP relay and I have implement it.\nbut I can't find an effective way to test this in real world networking.\nPlease create issues to help us if you know any applications that support\nUDP-socks well.\n\n## License\n\nBSD\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foyyd%2Fencryptsocks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foyyd%2Fencryptsocks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foyyd%2Fencryptsocks/lists"}