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

Clearnet p2p #317

Merged
merged 8 commits into from
Jul 2, 2019
Merged

Clearnet p2p #317

merged 8 commits into from
Jul 2, 2019

Conversation

sachaaaaa
Copy link

  • generate certs and stuff for SSL, after storage is ready
  • spin an HTTPS server for p2p instead of HTTP
  • use nat-upnp to punch hole. We try to read the existing mappings first, if that fails, we assume uPnP not enabled and we stop the server. If that works, we get the existing public ports in use. Then we try to punch from port 22100 to 22200, skipping the ports we know are already in use by other processes. After this, we can query nat-upnp for the public ip that we need to broadcast.
  • Allowed half p2p (one client with p2p, the other not) by adding a type REACHABLE/UNREACHABLE sent in the broadcast message. UNREACHABLE means that the client can't spin its HTTPS server but still needs to send that message to trigger the code path that allows half p2p.

Coming next: signing with signal pubkey of SSL cert + verification

Copy link

@BeaudanBrown BeaudanBrown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a few little bits

libloki/modules/local_loki_server.js Outdated Show resolved Hide resolved
libloki/modules/local_loki_server.js Outdated Show resolved Hide resolved
preload.js Show resolved Hide resolved
@@ -535,9 +548,11 @@
window.log.info('Cleanup: complete');

window.log.info('listening for registration events');
Whisper.events.on('registration_done', () => {
Whisper.events.on('registration_done', async () => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Whisper.events.on('registration_done', async () => {
Whisper.events.on('registration_done', () => {

Un-needed async

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do in separate PR

@BeaudanBrown BeaudanBrown merged commit ba87668 into oxen-io:clearnet Jul 2, 2019
@sachaaaaa sachaaaaa deleted the https_p2p branch July 5, 2019 00:24
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

Successfully merging this pull request may close these issues.

3 participants