{"id":13825884,"url":"https://github.com/psiphon-labs/psiphon-tunnel-core","last_synced_at":"2025-07-08T22:32:52.756Z","repository":{"id":20684821,"uuid":"23967971","full_name":"Psiphon-Labs/psiphon-tunnel-core","owner":"Psiphon-Labs","description":"Psiphon is an Internet censorship circumvention system.","archived":false,"fork":false,"pushed_at":"2024-11-19T19:15:37.000Z","size":83754,"stargazers_count":919,"open_issues_count":2,"forks_count":268,"subscribers_count":83,"default_branch":"master","last_synced_at":"2024-11-19T20:23:35.575Z","etag":null,"topics":["censorship-circumvention","golang","psiphon"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Psiphon-Labs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2014-09-12T16:23:51.000Z","updated_at":"2024-11-19T19:15:42.000Z","dependencies_parsed_at":"2023-02-18T10:45:22.400Z","dependency_job_id":"7e41b961-9bce-4bcb-8340-bcfcd30bc6d5","html_url":"https://github.com/Psiphon-Labs/psiphon-tunnel-core","commit_stats":{"total_commits":2840,"total_committers":23,"mean_commits":"123.47826086956522","dds":"0.22605633802816905","last_synced_commit":"9142dd87bba8694a3c8e39612d0c874a15f7e2a9"},"previous_names":[],"tags_count":56,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Psiphon-Labs%2Fpsiphon-tunnel-core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Psiphon-Labs%2Fpsiphon-tunnel-core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Psiphon-Labs%2Fpsiphon-tunnel-core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Psiphon-Labs%2Fpsiphon-tunnel-core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Psiphon-Labs","download_url":"https://codeload.github.com/Psiphon-Labs/psiphon-tunnel-core/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225470631,"owners_count":17479366,"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":["censorship-circumvention","golang","psiphon"],"created_at":"2024-08-04T09:01:28.592Z","updated_at":"2025-07-08T22:32:52.743Z","avatar_url":"https://github.com/Psiphon-Labs.png","language":"Go","funding_links":[],"categories":["\u003ca id=\"01e6651181d405ecdcd92a452989e7e0\"\u003e\u003c/a\u003e工具"],"sub_categories":["\u003ca id=\"9d6789f22a280f5bb6491d1353b02384\"\u003e\u003c/a\u003e隧道\u0026\u0026穿透"],"readme":"[![CI](https://github.com/Psiphon-Labs/psiphon-tunnel-core/actions/workflows/tests.yml/badge.svg)](https://github.com/Psiphon-Labs/psiphon-tunnel-core/actions/workflows/tests.yml) [![Coverage Status](https://coveralls.io/repos/github/Psiphon-Labs/psiphon-tunnel-core/badge.svg?branch=master)](https://coveralls.io/github/Psiphon-Labs/psiphon-tunnel-core?branch=master)\n\n\nPsiphon Tunnel Core README\n================================================================================\n\nOverview\n--------------------------------------------------------------------------------\n\nPsiphon is an Internet censorship circumvention system.\n\nThe tunnel core project includes a tunneling client and server, which together implement key aspects of evading blocking and relaying client traffic through Psiphon and beyond censorship.\n\nAll Psiphon open source projects, including the complete open source code for Android, iOS, and Windows clients may be found at [www.github.com/Psiphon-Inc/psiphon](https://www.github.com/Psiphon-Inc/psiphon).\n\nFor more information about Psiphon Inc., please visit our web site at [www.psiphon.ca](https://www.psiphon.ca).\n\n```\npsiphon-tunnel-core\n  └── ClientLibrary  General client libraries\n  └── ConsoleClient  CLI client program\n  └── MobileLibrary  Android/iOS client libraries\n  └── Server         Server program\n  └── psiphon        Client code package\n    └── common\\...   Common code packages\n    └── server       Server code package\n```\n\n\nTechnical Summary\n--------------------------------------------------------------------------------\n\nPsiphon tunnels Internet traffic through a network of proxy servers with the goal of circumventing Internet censorship.\n\nUsers run a client program which connects to a proxy server and routes client host Internet traffic through a tunnel established to the proxy. Traffic egresses from the proxy, which is located beyond the entity censoring the user's Internet.\n\n### Traffic Routing\n\nPsiphon has multiple routing modes:\n- Port forward mode: the client runs localhost SOCKS and HTTPS proxies and the client host or individual apps are configured to use these local proxies; each connection to a local proxy is related through the tunnel to the server.\n- Packet tunnel mode: the client relays IP packets between a host \"tun\" device and the server.\n\n### Traffic Security\n\nAt the core of all tunnels is an SSH connection which protects the confidentiality and integrity of client traffic between the client host and the proxy server. Clients authenticate the SSH server using pre-shared public keys, ensuring clients connect only to authentic Psiphon servers.\n\n### Server Entries\n\nServer connection information, including SSH public keys, addresses, and obfuscation parameters are distributed to clients in the form of a list of \"server entries\". Each server entry fully describes one Psiphon server.\n\nClients binaries may be built with embedded server lists. Clients may also \"discover\" new server entries when they successfully connect to a server.\n\nPsiphon also uses out-of-band server list delivery mechanisms, including fetching server lists from drops which are configured in the clients. All out-of-band mechanisms perform additional server list verification using public keys configured in the clients.\n\nAll delivery mechanisms use partitioning to prevent trivial enumeration of all server entries.\n\nSome out-of-band server server lists, called [\"obfuscated server lists\"](psiphon/common/osl/README.md), are encrypted and only clients that have been granted sufficient required keys can access the included servers.\n\n### Traffic Obfuscation\n\nThe core SSH protocol is wrapped in optional obfuscation layers which transform traffic in order to evade blocking of Psiphon servers. Mitigated attacks include endpoint blocking, keyword-based blocking, DPI-based blocking, and more.\n\nObfuscation techniques include:\n- Making traffic on the wire look fully random.\n- Making traffic on the wire look like popular implementations of popular protocols.\n- Performing traffic shaping to obscure the size and timing properties of encapsulated traffic.\n- Connecting to proxy servers indirectly, via intermediaries.\n\n### Circumvention Optimizations\n\nTo minimize connection time, Psiphon makes multiple concurrent connection attempts to different servers using different obfuscation techniques. This process generally selects the fastest working obfuscation technique and server. This process is how Psiphon load balances clients across its network of servers without using a centralized load balancing mechanism.\n\nA successful connection may be subject to further quality tests before selection. The Psiphon client remembers which servers and which obfuscation techniques and parameters are successful and prioritizes using the same on subsequent connections.\n\nPsiphon uses a mechanism called [\"tactics\"](psiphon/common/tactics) to remotely deliver targeted, optimized configuration and obfuscation parameters to clients.\n\n\nRunning Psiphon\n--------------------------------------------------------------------------------\n\n### Get the programs\n\nOfficial binaries are avaiable at:\n- https://github.com/Psiphon-Labs/psiphon-tunnel-core-binaries\n- https://github.com/Psiphon-Labs/psiphon-tunnel-core/releases, for libraries\n\nFor these instructions, use:\n- [psiphond](https://github.com/Psiphon-Labs/psiphon-tunnel-core-binaries/blob/master/psiphond/psiphond)\n- [ConsoleClient](https://github.com/Psiphon-Labs/psiphon-tunnel-core-binaries/blob/master/linux/psiphon-tunnel-core-x86_64)\n\n### Generate configuration data\n\nRun the \"generate\" mode of psiphond to generate configs, setting the IP address as appropriate; this is the address the client will use to connect to the server.\n\n```\n$ ./psiphond -ipaddress 127.0.0.1 -protocol OSSH:9999 generate\n\n$ ls\npsiphond\npsiphond.config\npsiphond-osl.config\npsiphond-tactics.config\npsiphond-traffic-rules.config\nserver-entry.dat\n```\n\nCreate a client config file, copying the contents of `server-entry.dat` to the `TargetServerEntry` field.\n\n```\n$ cat server-entry.dat \n3132372e302e302e31202020207b22746167223a22222c2269[...]\n\n$ cat client.config\n{\n    \"LocalHttpProxyPort\" : 8080,\n    \"LocalSocksProxyPort\" : 1080,\n\n    \"PropagationChannelId\" : \"24BCA4EE20BEB92C\",\n    \"SponsorId\" : \"721AE60D76700F5A\",\n\n    \"TargetServerEntry\" : \"3132372e302e302e31202020207b22746167223a22222c2269[...]\"\n}\n```\n\n### Run psiphond\n\n```\n$ ./psiphond run\n{\"localAddress\":\"127.0.0.1:9999\",\"msg\":\"listening\",\"tunnelProtocol\":\"OSSH\",[...]}\n{\"localAddress\":\"127.0.0.1:9999\",\"msg\":\"running\",\"tunnelProtocol\":\"OSSH\",[...]}\n[...]\n```\n\n### Run the console client\n\n```\n$ ./ConsoleClient -config ./client.config\n{\"data\":{\"port\":1080},\"noticeType\":\"ListeningSocksProxyPort\",[...]}\n{\"data\":{\"port\":8080},\"noticeType\":\"ListeningHttpProxyPort\",[...]}\n[...]\n{\"data\":{\"count\":1},\"noticeType\":\"Tunnels\",[...]}\n```\n\n### Tunnel traffic through Psiphon\n\nUse the local SOCKS proxy (port 1080) or HTTP proxy (port 8080) to tunnel traffic.\n\n\nUsing Psiphon with Go modules\n--------------------------------------------------------------------------------\n\nThe github.com/Psiphon-Labs/psiphon-tunnel-core Go module may be imported into\nother Go programs. Due to legacy release tags predating use of Go modules in\nthis repository, neither `go get ...@latest` nor `go get ...@tag` are\nsupported at this time. To use the psiphon-tunnel-core Go module and its\ndependencies, reference a specific commit, or reference the `staging-client`\nbranch, which is the client-side, production-ready branch:\n\n```\n% go get github.com/Psiphon-Labs/psiphon-tunnel-core@staging-client\ngo: added github.com/Psiphon-Labs/psiphon-tunnel-core v1.0.11-0.20240424194431-3612a5a6fb4c\n```\n\n\nAcknowledgements\n--------------------------------------------------------------------------------\n\nPsiphon Tunnel Core uses the following Go modules: https://github.com/Psiphon-Labs/psiphon-tunnel-core/blob/master/go.mod\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpsiphon-labs%2Fpsiphon-tunnel-core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpsiphon-labs%2Fpsiphon-tunnel-core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpsiphon-labs%2Fpsiphon-tunnel-core/lists"}