Git Product home page Git Product logo

p2p-over-middleboxes-demo's Introduction

P2P-Over-MiddleBoxes-Demo

A simple demo of P2P communication over middle boxes such as NAT

p2pchat

build:

make p2pchat

run:

./p2pchat/server port

./p2pchat/client server:port
>>> help

test

build:

make test

run:

./run_test.sh

FAQ

It doesn't work?

This UDP hole punching demo only works on Cone NAT.

How to check my NAT type?

There is a simple python script to test your NAT type using RFC3489(the classic STUN protocol) in stun. You can simply check it by running:

cd stun
python3 classic_stun_client.py [your-local-ip]

And the result would be similar with:

INFO:root:running test I with stun.ideasip.com:3478
INFO:root:MAPPED_ADDRESS: 220.181.57.217:46208
INFO:root:running test II with stun.ideasip.com:3478
INFO:root:running test I with 217.116.122.138:3479
INFO:root:MAPPED_ADDRESS: 220.181.57.217:2732
NAT_TYPE: Symmetric NAT

My NAT is cone NAT, but it still doesn't work

If two of your peers are both behind the same NAT, this NAT must support LOOPBACK TRANSMISSION to forward messages. You can test it by using the utils(udp_server/udp_client) in tools

related post (in Chinese)

NOTE: This is just a proof of concept project. If you want to build a stable P2P application, please refer to STUN/TURN and ICE protocol as well.

p2p-over-middleboxes-demo's People

Contributors

evilpan avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.