{"id":22355604,"url":"https://github.com/zbo14/tete","last_synced_at":"2025-07-30T10:31:57.413Z","repository":{"id":49226161,"uuid":"378018940","full_name":"zbo14/tete","owner":"zbo14","description":"Encrypted p2p connections through firewalls","archived":false,"fork":false,"pushed_at":"2021-07-01T15:15:01.000Z","size":34,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"develop","last_synced_at":"2024-06-20T22:37:11.523Z","etag":null,"topics":["golang","hole-punching","nats","p2p","tcp","tls","unix"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zbo14.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":"2021-06-18T03:03:07.000Z","updated_at":"2024-02-20T20:51:49.000Z","dependencies_parsed_at":"2022-08-28T09:11:18.425Z","dependency_job_id":null,"html_url":"https://github.com/zbo14/tete","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zbo14%2Ftete","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zbo14%2Ftete/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zbo14%2Ftete/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zbo14%2Ftete/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zbo14","download_url":"https://codeload.github.com/zbo14/tete/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228124659,"owners_count":17873170,"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":["golang","hole-punching","nats","p2p","tcp","tls","unix"],"created_at":"2024-12-04T14:07:22.706Z","updated_at":"2024-12-04T14:07:23.405Z","avatar_url":"https://github.com/zbo14.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tete\n\nAs in *tête-à-tête*.\n\nPeer-to-peer TLS connections through firewalls via TCP hole-punching.\n\n## Why?\n\nThe goal: easily allow 2 peers to establish a secure connection after exchanging public IP addresses and port numbers.\n\nHowever, there are several difficulties with creating and maintaining encrypted p2p connections:\n\n* NAT routers blocking/dropping TCP connections between peers on different networks\n* Coordinating TLS negotiation when neither peer is hosting a persistent server on a domain\n* Adapting to socket APIs that are based on a client-server paradigm\n\n`tete` addresses these challenges and creates abstractions that hopefully make secure p2p communication easier for people and other applications.\n\nThis repository contains a command line tool that does the following:\n\n* Establish TLS connections between peers on different networks\n* Read data from stdin and send it over a connection\n* Read encrypted data from connection and write decrypted data to stdout\n\nThis makes `tete` easy to use with other tools (e.g. by piping to UNIX commands or other CLIs).\n\n## Install\n\n`go get -u github.com/zbo14/tete`\n\n## Usage\n\nSuppose Alice (rather, the router on her home network) has public IPv4 address \"1.2.3.4\". Her computer has a process listening on port 12345.\n\nBob is behind a router with public IPv4 address \"5.6.7.8\". His machine is listening on port 56789.\n\nIn her terminal, Alice would type:\n\n`$ tete -myip 1.2.3.4 -peerip 5.6.7.8 -lport 12345 -rport 56789`\n\nIn his terminal, Bob would type:\n\n`$ tete -myip 5.6.7.8 -peerip 1.2.3.4 -lport 56789 -rport 12345`\n\n**Note:** each peer *must* specify their own public IP address. IP address comparison determines which peer acts as a server and which acts as a client in the TLS handshake.\n\nAfter pressing enter, they both should see the following printed to stderr:\n\n`\u003cdate\u003e \u003ctime\u003e Connected to peer!`\n\nNow, they can write to stdin to send data over the secure connection and read data from stdout.\n\nThe connection closes when Alice or Bob issues an interrupt signal.\n\nThey should see the following printed to stderr:\n\n`\u003cdate\u003e \u003ctime\u003e Closed connection` or `\u003cdate\u003e \u003ctime\u003e Peer closed connection`\n\n```\nUsage of tete:\n    -h  show usage information and exit\n    -k  enable TCP keepalives\n    -lport int\n        local port you're listening on (default 54312)\n    -myip string\n        your public IPv4/IPv6 address\n    -peerip string\n        peer's public IPv4/IPv6 address\n    -rport int\n        remote port the peer's listening on (default 54312)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzbo14%2Ftete","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzbo14%2Ftete","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzbo14%2Ftete/lists"}