Closed LuKks closed 2 years ago
I think I was using different minor versions of secret-stream
.
Yep.
server
using latest
mkdir secret-server
npm init -y
npm i utp-native @hyperswarm/secret-stream
nano server.js
const UTP = require('utp-native')
const SecretStream = require('@hyperswarm/secret-stream')
const utp = UTP()
utp.on('connection', (rawStream) => {
console.log('utp connection', rawStream.remoteAddress, rawStream.remotePort)
const secret = new SecretStream(false, rawStream)
})
utp.listen(3000)
client
using 5.0.0
mkdir secret-client
npm init -y
npm i utp-native @hyperswarm/secret-stream@5.0.0
nano client.js
const UTP = require('utp-native')
const SecretStream = require('@hyperswarm/secret-stream')
const utp = UTP()
const rawStream = utp.connect(3000, '127.0.0.1')
const secret = new SecretStream(true, rawStream)
Later just run:
node secret-server/server.js
node secret-client/client.js
Is this intended?
Yep, that was a recent bug fix, always use the latest versions in general as we stabilise.
server.js
client.js
DigitalOcean as server and my computer as client doesn't work. Am I missing something?
Running all in localhost works. DigitalOcean as server and another DO as client also works.
I created a new DigitalOcean server and used my same computer and it's working, so maybe it's probably something related to the previous specific server.
Because it's difficult to reproduce I can give those logs:
At least this shows that the handshake is happening before the final error.
In case you have any hints, I can test them in the current state (the specific DO server and my computer). I think I will try to replicate the issue in a new server but at the moment I couldn't.
In the specific DO server I had just one folder "like-p2p" which is a git repository, I was deleting .git/ and some other non related files, so only the related files remain and I can give you access. Now I can't reproduce it anymore.
Sorry if this is confusing, at least you can check the logs in case something makes sense. Feel free to close the issue.