Java Networking Without Port Forwarding
I have been trying to brainstorm ways to get around port forwarding in a P2P client/server relationship between standard household networks (usually NAT).
I am not willing nor able to setup a server for users to connect to (I myself am behind a NAT) and that ruins the whole point of my application. It is supposed to be a P2P relationship.
I am aware of the UDP hole punching technique which as intrigued me quite a bit. However, it still requires an external server to forward the request. Which, I cannot setup.
Does anybody have any ideas how to possibly establish P2P connections while avoiding port forwarding programmatically? Or at the very least, a more secure and easy method rather than port forwarding (or VPNs)?
I was thinking about servlets (as I mentioned in another thread that got ignored). But, I am fairly certain that still requires a server for me to setup. Not to mention I can't seem to figure out how to get servlet support into Eclipse...
Re: Java Networking Without Port Forwarding
bump because I am interested in an answer to this as well
Re: Java Networking Without Port Forwarding
Direct connection between peers on private networks? You can't. That's a VeryGoodThing that most sane people would wish to maintain.
Quote:
I am not willing nor able to setup a server
Get a cheap VPS and install your private-peer-matchmaking software there. Lowendbox have on their front page USD2/month Xen VPS (OpenVZ was a nightmare for Java on a small VPS last time I tried it): Low End Box - Cheap VPS Hosting Providers Listing & Reviews
If $2 per month is too expensive, I guess you could try setting up your private-peer-matchmaking app on an old PC on your desk and using Dynamic DNS to make it publicly accessible. Your electricity bills for 24/7 on anything over an iPad will dwarf $2/month though.
Re: Java Networking Without Port Forwarding
Quote:
Originally Posted by
Sean4u
Direct connection between peers on private networks? You can't. That's a VeryGoodThing that most sane people would wish to maintain
I mean... it is certainly possible through port forwarding or a VPN service... that is how you use P2P programs.
The idea was to make it simpler and easier by using some sort of UDP punching technique to forward a client request. The problem is you need an outside, public server to do that.
Re: Java Networking Without Port Forwarding
Quote:
that is how you use P2P programs
Are you sure? I don't know for sure myself, to be honest. If your private network is connected to the public network via NAT, how does any host on the public or private network address a network packet to a host on your private network? It absolutely cannot without the co-operation of the host doing NAT. There is at least one standard of sorts for this - it's Universal Plug and Play (UPnP) - and there are java projects:
java upnp - Google Search
Universal Plug and Play - Wikipedia, the free encyclopedia
The problem is that without that third host, you really do need something on the private network that is capable of mapping public traffic onto private traffic with a little help from some config supplied by private hosts. UPnP might work, but not all routers can do it and not all that can can do it well.