{"id":20597005,"url":"https://github.com/tradle/wire","last_synced_at":"2025-08-22T02:08:21.392Z","repository":{"id":66294801,"uuid":"65106367","full_name":"tradle/wire","owner":"tradle","description":"duplex stream with axolotl ratchet","archived":false,"fork":false,"pushed_at":"2016-09-30T16:52:05.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-06T15:18:35.998Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tradle.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-08-06T23:29:21.000Z","updated_at":"2016-08-06T23:29:54.000Z","dependencies_parsed_at":"2023-02-22T13:00:57.164Z","dependency_job_id":null,"html_url":"https://github.com/tradle/wire","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tradle/wire","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tradle%2Fwire","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tradle%2Fwire/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tradle%2Fwire/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tradle%2Fwire/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tradle","download_url":"https://codeload.github.com/tradle/wire/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tradle%2Fwire/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271574431,"owners_count":24783319,"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","status":"online","status_checked_at":"2025-08-22T02:00:08.480Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-16T08:19:50.144Z","updated_at":"2025-08-22T02:08:21.370Z","avatar_url":"https://github.com/tradle.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Usage\n\nwork in progress!  \n\nuses [alax/forward-secrecy](https://github.com/alax/forward-secrecy)\n\n```js\nconst net = require('net')\nconst nacl = require('tweetnacl')\nconst Wire = require('@tradle/wire')\n// alice's long term identity key\nconst alice = nacl.box.keyPair()\n// bob's long term identity key\nconst bob = nacl.box.keyPair()\n\nconst a = new Wire({\n  identity: alice,\n  theirIdentity: bob.publicKey\n})\n\nconst b = new Wire({\n  identity: bob,\n  theirIdentity: alice.publicKey\n})\n\n// pipe directly:\n// a.pipe(b).pipe(a)\n\n// via TCP connection:\nconst aliceServer = net.createServer(function (connection) {\n  a.pipe(connection).pipe(a)\n})\n\naliceServer.listen(2345)\nconst bobConnection = net.connect(2345)\nb.pipe(bobConnection).pipe(b)\n\na.send('hey!') // String|Buffer\nb.on('message', function (msg) {\n  console.log('alice says: ' + msg.toString())\n  bobConnection.end()\n  aliceServer.close()\n})\n```\n\nTodo:\n\nSave and reuse sessions. Ccurrently a new session is established each time.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftradle%2Fwire","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftradle%2Fwire","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftradle%2Fwire/lists"}