Skip to content

Commit

Permalink
SWARM-BREAKING: fix crypto server/client orientation
Browse files Browse the repository at this point in the history
Previously servers were connecting as clients, and clients as servers.
This was having an impact (somehow) on holepunched peers. This fixes it
so each role behaves as such from a hypercore-protocol perspective.
  • Loading branch information
hackergrrl committed Jun 7, 2020
1 parent 7c3413e commit 2132439
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion swarm.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports = function (cabal, opts, cb) {
swarm.on('connection', function (socket, info) {
let remoteKey

var r = cabal.replicate(!info.client)
var r = cabal.replicate(info.client)
pump(socket, r, socket, function (err) {
if (err) debug('ERROR', err)
if (remoteKey) cabal._removeConnection(remoteKey)
Expand Down

0 comments on commit 2132439

Please sign in to comment.