-
Notifications
You must be signed in to change notification settings - Fork 94
Conversation
} else { | ||
if (ma.protos()[2].name === 'ws') { | ||
return 'http://' + maStrSplit[3] | ||
} else if (ma.protos()[3].name === 'wss') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems wrong, why 2 in the ws case and 3 in the wss case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is wrong indeed (I couldn't test https without the cert)
fe1ab16
to
d47197b
Compare
return 'https://' + maStrSplit[3] | ||
} else { | ||
throw new Error('invalid multiaddr' + ma.toString()) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe simplify the code to avoid issues like before.
const wsToHttp = (name) => {
if (name === 'ws') {
return 'http'
}
if (name === 'wss') {
return 'https'
}
throw new Error('sad face')
}
const protocol = wsToHttp(ma.protos()[2].name)
return `${protocol}://${maStrSplit[3]}`
|
||
### Deployment | ||
|
||
We have a [dokku](https://github.com/ipfs/ops-requests/issues/31) setup ready for this to be deployed, to deploy simple do (you have to have permission first): | ||
|
||
```sh | ||
# if you already have added the remote, you don't need to do it again | ||
> git remote add dokku dokku@cloud.ipfs.team:webrtc-star-signalling | ||
> git remote add dokku dokku@cloud.ipfs.team:star-signall |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo, should be star-signal I'm assuming
const maLS = '/ip4/127.0.0.1/tcp/15555' | ||
const maGen = (base, id) => multiaddr(`/libp2p-webrtc-star${base}/ws/ipfs/${id}`) | ||
|
||
if (process.env.DNS) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably should prefix this env var so it becomes WEBRTC_START_DNS
instead, just to avoid any collisions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The currently deployed thing is called webrtc-star-signalling(.cloud.ipfs.team)
, is it gonna change? (No problem with that, just checking)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lgierth I would like it to be shorter, like star-signal.
or signal.
, but I'm happy with any, really.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, just make a call and deploy :) and I'll take care of setting up Let's Encrypt for all cloud.ipfs.team apps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
» ssh dokku@cloud.ipfs.team apps
=====> My Apps
star-signal
@lgierth do your magic 🎩 :D
@lgierth do your magic 🎩 :D |
@lgierth I've updated the module to support DNS and I've confirmed it works. To reproduce,
npm run test:dns
Requires:
Now all we need is that Certificate and that Reverse Proxy for WebSockets :)