Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block local connections from hyperswarm #93

Open
gmaclennan opened this issue Mar 9, 2023 · 0 comments
Open

Block local connections from hyperswarm #93

gmaclennan opened this issue Mar 9, 2023 · 0 comments

Comments

@gmaclennan
Copy link
Member

gmaclennan commented Mar 9, 2023

One way to avoid duplicate connections from both hyperswarm and mdns is to block local connections with hyperswarm (and block non-local connections on the hyperswarm socket see #68)

We can do this with opts.firewall once holepunchto/hyperswarm#131 is merged. E.g.

const { isPrivate } = require('bogon')

const swarm = new Hyperswarm({
  firewall: (remotePublicKey, payload, clientAddress) => !!clientAddress && isPrivate(clientAddress.host)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant