{"id":15637427,"url":"https://github.com/anderscan/p2p-socket","last_synced_at":"2025-10-07T22:02:07.122Z","repository":{"id":65562833,"uuid":"531523798","full_name":"AndersCan/p2p-socket","owner":"AndersCan","description":"Connect two machines across the web together via hyperdht.","archived":false,"fork":false,"pushed_at":"2023-07-03T21:38:35.000Z","size":988,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-30T06:08:01.663Z","etag":null,"topics":["holepunch","p2p"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AndersCan.png","metadata":{"files":{"readme":"readme.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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-09-01T13:07:44.000Z","updated_at":"2023-07-03T15:37:33.000Z","dependencies_parsed_at":"2024-10-03T11:11:38.928Z","dependency_job_id":null,"html_url":"https://github.com/AndersCan/p2p-socket","commit_stats":{"total_commits":35,"total_committers":2,"mean_commits":17.5,"dds":0.02857142857142858,"last_synced_commit":"0cfea475d4820f09535d31e5cf1c0bbd8372aeb8"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndersCan%2Fp2p-socket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndersCan%2Fp2p-socket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndersCan%2Fp2p-socket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndersCan%2Fp2p-socket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndersCan","download_url":"https://codeload.github.com/AndersCan/p2p-socket/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251651233,"owners_count":21621716,"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":["holepunch","p2p"],"created_at":"2024-10-03T11:11:37.293Z","updated_at":"2025-10-07T22:02:07.055Z","avatar_url":"https://github.com/AndersCan.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# p2p-socket\n\n![Banner image of three pears](https://raw.githubusercontent.com/AndersCan/p2p-socket/main/banner.jpg)\n\n---\n\nConnect two machines across the web together via the [hyperdht](https://github.com/holepunchto/hyperswarm-dht).\n\n---\n\n\u003c/div\u003e\n\n## Highlights\n\n- No sentral server\n  - Connections are direct between machines (Peer to Peer)\n- Encrypted end-to-end.\n\nRun `npx p2p-socket --help` for usage instuctions. Currently only supports TCP, but UDP can/will be added later.\n\n## Quick start\n\nA p2p-socket is just an easy way to connect to another machine over the internet. Here is a step-by-step guide on how Alice can share `localhost:3000` with Bob.\n\n### Sharing\n\nFor Alice to share `localhost:3000` with Bob, she would run:\n\n```bash\n# Alice\nnpx p2p-socket share --port 3000\n```\n\nThis will print the connection information that Alice will have to share with Bob. Note that nobody on the network will find Alice unless she shares her public key with them.\n\n### Connect\n\nTo connect, Bob will run:\n\n```bash\n# Bob\nnpx p2p-socket connect --port 3000 --remote-key \u003calice-public-key\u003e\n```\n\nBob can now access `localhost:3000` and reach Alice.\n\n## Persistant remote-key\n\nTo avoid having to reshare your connection information each time you restart your server, run `npx p2p-socket create-id`. This will create an `identity.json` file locally. This will enable a consistent `remote-key`.\n\n\u003e Note: The key will still change if you change `host` and `port`\n\n## Acknowledgements\n\nInspired by [hyperswarm-http-server](https://github.com/mafintosh/hyperswarm-http-server) and made possible by [🕳🥊Holepunch](https://holepunch.to/) tech.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanderscan%2Fp2p-socket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanderscan%2Fp2p-socket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanderscan%2Fp2p-socket/lists"}