stacks-archive / blockstack-browser

The Blockstack Browser
Mozilla Public License 2.0
1.12k stars 199 forks source link

Handling port conflicts #316

Open larrysalibra opened 7 years ago

larrysalibra commented 7 years ago

Blockstack uses a number of ports and conflicts are going to happen.

Pietrorea on twitter points out that Portal's port 8888 conflicts with charles proxy: https://twitter.com/pietrorea/status/841770893714067457

Port conflicts also happen when more than one user on a machine uses blockstack (#309).

There's an existing discussion on the forum about how to address these issues: https://forum.blockstack.org/t/multi-user-support-on-macos-beyond/808?u=larry

shea256 commented 7 years ago

Can we just start at 8888 and increment if there's a conflict?

johnurbanik commented 6 years ago

This issue has come up several times recently (#1059, #978). I think @shea256's suggesting of incrementing ports is relatively reasonable, though I'd suggest also eventually supporting a config file.

The canonical package for finding open ports in node is https://github.com/indexzero/node-portfinder; it should be straightforward to integrate this into blockstackProxy.js.

larrysalibra commented 6 years ago

Our refined architecture plan should should make it so that we don't have to have daemons listening on ports at all: