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

Allow the hosted node to accept secure websocket connections #85

Closed
dholms opened this issue Aug 21, 2019 · 2 comments
Closed

Allow the hosted node to accept secure websocket connections #85

dholms opened this issue Aug 21, 2019 · 2 comments
Labels
👩‍💻👨‍💻 DX Developer experience 💗 enhancement New feature or request 🚠 infrastructure What we use to run our services

Comments

@dholms
Copy link
Collaborator

dholms commented Aug 21, 2019

Summary

Problem

In-browser nodes can only communicate via WebRTC and Websocket connections and therefore can't reach our hosted node.

Impact

If a user does not use an ipfs-enabled browser and falls back to an in-browser js-ipfs node, their node will be siloed from our network.

Solution

  • Make the hosted node listen for incoming websocket connections
  • go-ipfs only supports ws not wss
    • Allow wss through something like nginx
    • Unsure if js-ipfs supports wss

Detail

Enable websockets
Add an address of the format /ip4/127.0.0.1/tcp/4002/ws to ~/.ipfs/config or ~/.jsipfs/config

Some relevant threads
libp2p/go-libp2p#188
ipfs/kubo#3907
INFURA/infura#101

To test with User settings app

  • Add peerID of hosted node to bootstrap list in src/ipfs/preferences.js(8)
  • Run app
  • Either:
    • Change user settings and the query web-api at hostless.dev to check that it can find CID
    • Log peer list of js-ipfs node after connect and make sure it includes the relevant peerID. Something like:
const getIpfs = async () => {
  const ipfs = await getIpfsWithConfig({
    bootstrap: [
      "/ip4/127.0.0.1/tcp/4002/ws/ipfs/QmY4N8hPzGQUPDJc8tMWuQokJswStUZk9SkBACCHoVZpCS"
    ]
  });
  setTimeout(async () => {
    const peers = await ipfs.swarm.peers()
    console.log("Peerlist: ", peers)
  }, 2000)
  return ipfs
};

(in src/ipfs/preferences)

@dholms dholms added 💗 enhancement New feature or request 👩‍💻👨‍💻 DX Developer experience 🚠 infrastructure What we use to run our services labels Aug 21, 2019
@expede
Copy link
Member

expede commented Aug 22, 2019

So the good news is that we probably can delay doing this in code for a while, since we have a TLS proxy already 👍

@expede
Copy link
Member

expede commented Sep 5, 2019

No need, cluster is set up with Nginx

@expede expede closed this as completed Sep 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👩‍💻👨‍💻 DX Developer experience 💗 enhancement New feature or request 🚠 infrastructure What we use to run our services
Projects
None yet
Development

No branches or pull requests

2 participants