{"id":13509892,"url":"https://github.com/yinqiwen/gsnova","last_synced_at":"2025-04-05T02:11:29.618Z","repository":{"id":3805731,"uuid":"4885084","full_name":"yinqiwen/gsnova","owner":"yinqiwen","description":"Private proxy solution \u0026 network troubleshooting tool.","archived":false,"fork":false,"pushed_at":"2021-02-04T09:34:26.000Z","size":21414,"stargazers_count":559,"open_issues_count":69,"forks_count":189,"subscribers_count":79,"default_branch":"master","last_synced_at":"2025-03-29T01:13:42.582Z","etag":null,"topics":["http","http2","kcp","low-memory","mitmproxy","nat","p2p","p2s2p","packet-capture","proxy","quic","ssh","tcp","tls","transparent-proxy","websocket"],"latest_commit_sha":null,"homepage":"","language":"Go","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/yinqiwen.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}},"created_at":"2012-07-04T14:01:21.000Z","updated_at":"2025-02-21T02:06:45.000Z","dependencies_parsed_at":"2022-09-18T18:15:21.631Z","dependency_job_id":null,"html_url":"https://github.com/yinqiwen/gsnova","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yinqiwen%2Fgsnova","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yinqiwen%2Fgsnova/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yinqiwen%2Fgsnova/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yinqiwen%2Fgsnova/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yinqiwen","download_url":"https://codeload.github.com/yinqiwen/gsnova/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247276189,"owners_count":20912288,"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":["http","http2","kcp","low-memory","mitmproxy","nat","p2p","p2s2p","packet-capture","proxy","quic","ssh","tcp","tls","transparent-proxy","websocket"],"created_at":"2024-08-01T02:01:16.175Z","updated_at":"2025-04-05T02:11:29.599Z","avatar_url":"https://github.com/yinqiwen.png","language":"Go","funding_links":[],"categories":["Go","\u003ca id=\"1a9934198e37d6d06b881705b863afc8\"\u003e\u003c/a\u003e通信\u0026\u0026代理\u0026\u0026反向代理\u0026\u0026隧道","Go (531)","\u003ca id=\"d03d494700077f6a65092985c06bf8e8\"\u003e\u003c/a\u003e工具","websocket"],"sub_categories":["\u003ca id=\"56acb7c49c828d4715dce57410d490d1\"\u003e\u003c/a\u003e未分类-Proxy","\u003ca id=\"0ff94312f3ab4898f5996725133ea9d1\"\u003e\u003c/a\u003e未分类"],"readme":"GSnova: Private Proxy Solution \u0026 Network Troubleshooting Tool.    \r\n[![Join the chat at https://gitter.im/gsnova/Lobby](https://badges.gitter.im/gsnova/Lobby.svg)](https://gitter.im/gsnova/Lobby?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\r\n[![Build Status](https://travis-ci.org/yinqiwen/gsnova.svg?branch=master)](https://travis-ci.org/yinqiwen/gsnova)\r\n\r\n```                                                                                                                                              \r\n                                                                    \r\n\t        ___          ___          ___          ___         ___          ___     \r\n\t       /\\  \\        /\\  \\        /\\__\\        /\\  \\       /\\__\\        /\\  \\    \r\n\t      /::\\  \\      /::\\  \\      /::|  |      /::\\  \\     /:/  /       /::\\  \\   \r\n\t     /:/\\:\\  \\    /:/\\ \\  \\    /:|:|  |     /:/\\:\\  \\   /:/  /       /:/\\:\\  \\  \r\n\t    /:/  \\:\\  \\  _\\:\\~\\ \\  \\  /:/|:|  |__  /:/  \\:\\  \\ /:/__/  ___  /::\\~\\:\\  \\ \r\n\t   /:/__/_\\:\\__\\/\\ \\:\\ \\ \\__\\/:/ |:| /\\__\\/:/__/ \\:\\__\\|:|  | /\\__\\/:/\\:\\ \\:\\__\\\r\n\t   \\:\\  /\\ \\/__/\\:\\ \\:\\ \\/__/\\/__|:|/:/  /\\:\\  \\ /:/  /|:|  |/:/  /\\/__\\:\\/:/  /\r\n\t    \\:\\ \\:\\__\\   \\:\\ \\:\\__\\      |:/:/  /  \\:\\  /:/  / |:|__/:/  /      \\::/  / \r\n\t     \\:\\/:/  /    \\:\\/:/  /      |::/  /    \\:\\/:/  /   \\::::/__/       /:/  /  \r\n\t      \\::/  /      \\::/  /       /:/  /      \\::/  /     ~~~~          /:/  /   \r\n\t       \\/__/        \\/__/        \\/__/        \\/__/                    \\/__/  \r\n                                                                    \r\n                                                                                                                                   \r\n```\r\n**Deprecated, use the rust version [rsnova](https://github.com/yinqiwen/rsnova) instead.**\r\n\r\n# Features\r\n- Multiple transport channel support\r\n    - http/https\r\n    - http2\r\n    - websocket\r\n    - tcp/tls\r\n    - quic\r\n    - kcp\r\n    - ssh\r\n- Multiplexing \r\n    - All proxy connections running over N persist proxy channel connections\r\n- Simple PAC(Proxy Auto Config)\r\n- Multiple Ciphers support\r\n    - Chacha20Poly1305\r\n    - Salsa20\r\n    - AES128\r\n- HTTP/Socks4/Socks5 Proxy\r\n    - Local client running as HTTP/Socks4/Socks5 Proxy\r\n- Transparent TCP/UDP Proxy\r\n\t- Transparent tcp/udp proxy implementation in pure golang\r\n- Multi-hop Proxy\r\n- TLS man-in-the-middle(MITM) Proxy\r\n- HTTP(S) Packet Capture for Web Debugging\r\n\t- Log HTTP(S) Packets in file\r\n\t- Forward HTTP(S) Packets to Remote HTTP Server\r\n- P2P/P2S2P Proxy\r\n    - P2P: Use TCP NAT tunnel for direct P2P commnunication if possible\r\n    - P2S2P: Use middle server for two peers to communication\r\n    - Use UPNP to expose port for remote p2p peer if possible.\r\n- Low-memory Environments Support\r\n    - Use less than 20MB RSS memory at client/server side\r\n\r\n\r\n# Usage\r\n**go1.9 or higher is requied.**\r\n\r\n## Compile\r\n```shell\r\n   go get -t -u -v github.com/yinqiwen/gsnova\r\n```\r\nThere is also prebuilt binary release at [here](https://github.com/yinqiwen/gsnova/releases)\r\n\r\n## Command Line  Usage\r\n```\r\nUsage of ./gsnova:\r\n  -admin string\r\n    \tClient Admin listen address\r\n  -blackList value\r\n    \tProxy blacklist item config\r\n  -client\r\n    \tLaunch gsnova as client.\r\n  -cmd\r\n    \tLaunch gsnova by command line without config file.\r\n  -cnip string\r\n    \tChina IP list. (default \"./cnipset.txt\")\r\n  -conf string\r\n    \tConfig file of gsnova.\r\n  -forward value\r\n    \tForward connection to specified address\r\n  -hosts string\r\n    \tHosts file of gsnova client. (default \"./hosts.json\")\r\n  -httpdump.dst string\r\n    \tHTTP Dump destination file or http url\r\n  -httpdump.filter value\r\n    \tHTTP Dump Domain Filter, eg:*.google.com\r\n  -key string\r\n    \tCipher key for transmission between local\u0026remote. (default \"809240d3a021449f6e67aa73221d42df942a308a\")\r\n  -listen value\r\n    \tListen on address.\r\n  -log string\r\n    \tLog file setting (default \"color,gsnova.log\")\r\n  -mitm\r\n    \tLaunch gsnova as a MITM Proxy\r\n  -ots string\r\n    \tOnline trouble shooting listen address\r\n  -p2p string\r\n    \tP2P Token.\r\n  -pid string\r\n    \tPID file (default \".gsnova.pid\")\r\n  -ping_interval int\r\n    \tChannel ping interval seconds. (default 30)\r\n  -pprof string\r\n    \tPProf trouble shooting listen address\r\n  -proxy string\r\n    \tProxy setting to connect remote server.\r\n  -remote value\r\n    \tNext remote proxy hop server to connect for client, eg:wss://xxx.paas.com\r\n  -servable\r\n    \tClient as a proxy server for peer p2p client\r\n  -server\r\n    \tLaunch gsnova as server.\r\n  -stream_idle int\r\n    \tMux stream idle timout seconds. (default 10)\r\n  -tls.cert string\r\n    \tTLS Cert file\r\n  -tls.key string\r\n    \tTLS Key file\r\n  -upnp int\r\n    \tUPNP port to expose for p2p.\r\n  -user string\r\n    \tUsername for remote server to authorize. (default \"gsnova\")\r\n  -version\r\n    \tPrint version.\r\n  -whitelist value\r\n    \tProxy whitelist item config\r\n  -window string\r\n    \tMax mux stream window size, default 512K\r\n  -window_refresh string\r\n    \tMux stream window refresh size, default 32K\r\n```\r\n\r\n## Deploy \u0026 Run Server\r\n\r\n```shell\r\n   ./gsnova -cmd -server -listen tcp://:48100 -listen quic://:48100 -listen tls://:48101 -listen kcp://:48101 -listen http://:48102 -listen http2://:48103  -key 809240d3a021449f6e67aa73221d42df942a308a -user \"*\"\r\n```\r\nThis would launch a running instance listening at serveral ports with different transport protocol.  \r\n\r\nThe server can also be deployed to serveral PAAS service like heroku/openshift and some docker host service.  \r\n\r\n## Deploy \u0026 Run Client\r\n\r\n### Run From Command Line\r\n```\r\n   ./gsnova -cmd -client -listen :48100 -remote http2://app1.openshiftapps.com  -key 809240d3a021449f6e67aa73221d42df942a308a\r\n```\r\nThis would launch a socks4/socks5/http proxy at port 48100 and use http2://app1.openshiftapps.com as next proxy hop.\r\n\r\n### Run With Confguration\r\n\r\nThis is a sample for [client.json](https://github.com/yinqiwen/gsnova/blob/master/client.json), the `Key` and the `ServerList` need to be modified to match your server.\r\n```\r\n   ./gsnova -client -conf ./client.json\r\n```\r\n\r\n### Advanced Usage\r\n#### Multi-Hop Proxy\r\nGSnova support more than ONE remote server as the next hops, just add more `-remote server` arguments to enable multi-hop proxy.     \r\nThis would use `http2://app1.openshiftapps.com` as the first proxy ho and use `wss://app2.herokuapp.com` as the final proxy hop.\r\n```shell\r\n   ./gsnova -cmd -client -listen :48101 -remote http2://app1.openshiftapps.com -remote wss://app2.herokuapp.com -key 809240d3a021449f6e67aa73221d42df942a308a\r\n```\r\n#### Transparent Proxy\r\n- Edit iptables rules.\r\n- It's only works on linux.\r\n\r\n#### MITM Proxy\r\nGSnova support running the client as a MITM proxy to capture HTTP(S) packets for web debuging.    \r\nThis would capture HTTP(S) traffic packets into local dist file `httpdump.log`.\r\n```shell\r\n   ./gsnova -cmd -client -listen :48101 -remote direct -mitm -httpdump.dst ./httpdump.log -httpdump.filter \"*.google.com\" -httpdump.filter \"*.facebook.com\"\r\n```\r\n\r\n#### P2P/P2S2P Proxy\r\nP2P/P2S2P Proxy can help you to connect two nodes, and use one of them as a tcp proxy server for the other one.  This feature can be used for scenarios like:       \r\n- Expose any tcp based service behind a NAT or firewall to a specific node in the internet.\r\n\r\nThere are 3 nodes which should install/run gsnova, a middle server(S) with public IP address, two client nodes(A \u0026 B)  behind a NAT or firewall.  \r\nFor the middle server(S), run as a server with a cipher key.\r\n```shell\r\n   ./gsnova -cmd -server  -listen tcp://:48103 -key p2pkey -log color\r\n```\r\nFor the node(B) as a proxy server, run as a client to connect server with a P2P token:\r\n```shell\r\n  ./gsnova -cmd -client -servable -key p2pkey -remote tcp://\u003cserver ip\u003e:48103 -p2p testp2p  -log color  \r\n```\r\nFor the node(A) as a client for peer proxy server, run as a client to connect server with same P2P token:\r\n```shell\r\n  ./gsnova -cmd -client -listen :7788 -key p2pkey -remote tcp://\u003cserver ip\u003e:48103 -p2p testp2p -log color  \r\n```\r\nIf there is no error, now the node A with listen address :7788 can be used as a http/socks4/socks5 proxy to access servers behind a NAT or firewall which node B located in.       \r\n\r\nAnd in gsnova, it would try to run with P2P mode first, if it's not pissible, it would use P2S2P mode which would use the middle server to forward tcp stream to remote peeer.  \r\n\r\n## Mobile Client(Android)\r\nThe client side can be compiled to android library by `gomobile`, eg:\r\n```\r\n   gomobile bind -target=android -a -v github.com/yinqiwen/gsnova/local/gsnova\r\n```\r\nUsers can develop there own app by using the generated `gsnova.aar`.   \r\nThere is a very simple andorid app [gsnova-android-v0.27.3.1.zip](https://github.com/yinqiwen/gsnova/releases/download/v0.27.3/gsnova-android-v0.27.3.1.zip) which use `tun2socks` + `gsnova` to build. \r\n\r\n\r\n\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyinqiwen%2Fgsnova","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyinqiwen%2Fgsnova","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyinqiwen%2Fgsnova/lists"}