Skip to content

Commit

Permalink
Merge branch 'main' of github.com:HDegroote/hypertele into npm-deps
Browse files Browse the repository at this point in the history
# Conflicts:
#	package.json
  • Loading branch information
HDegroote committed Apr 3, 2024
2 parents 821b098 + ab9d258 commit 080c6e7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
5 changes: 2 additions & 3 deletions client.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,13 @@ const stats = {}

const dht = new HyperDHT({
bootstrap,
keyPair
keyPair,
connectionKeepAlive: conf.keepAlive
})

const proxy = net.createServer({ allowHalfOpen: true }, c => {
return connPiper(c, () => {
const stream = dht.connect(Buffer.from(peer, 'hex'), { reusableSocket: true })
stream.setKeepAlive(conf.keepAlive)

return stream
}, { compress: conf.compress }, stats)
})
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hypertele",
"version": "1.1.2",
"version": "1.1.3",
"description": "TCP proxy over Hyperswarm!",
"main": "index.js",
"dependencies": {
Expand All @@ -9,7 +9,7 @@
"hyper-cmd-lib-keys": "^0.1.0",
"hyper-cmd-lib-net": "^0.1.0",
"hyper-cmd-lib-utils": "^0.1.0",
"hyperdht": "^6.11.0",
"hyperdht": "^6.14.0",
"minimist": "^1.2.5"
},
"bin": {
Expand Down
3 changes: 2 additions & 1 deletion pub.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ if (!+argv.l) {
}

const conf = {}
conf.keepAlive = 5000

if (argv.seed) {
conf.seed = argv.seed
Expand Down Expand Up @@ -51,7 +52,7 @@ const debug = argv.debug

const seed = Buffer.from(conf.seed, 'hex')

const dht = new HyperDHT()
const dht = new HyperDHT({ connectionKeepAlive: conf.keepAlive })
const keyPair = HyperDHT.keyPair(seed)

const stats = { cid: 0 }
Expand Down
7 changes: 6 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ if (argv.u && argv.l) {
}

const conf = {}
conf.keepAlive = 5000

if (argv.seed) {
conf.seed = argv.seed
Expand Down Expand Up @@ -69,7 +70,11 @@ const debug = argv.debug

const seed = Buffer.from(conf.seed, 'hex')

const dht = new HyperDHT({ bootstrap })
const dht = new HyperDHT({
bootstrap,
connectionKeepAlive: conf.keepAlive
})

const keyPair = HyperDHT.keyPair(seed)

const stats = {}
Expand Down

0 comments on commit 080c6e7

Please sign in to comment.