Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: Java Networking Without Port Forwarding

  1. #1
    Member
    Join Date
    Jun 2011
    Posts
    182
    My Mood
    Where
    Thanks
    15
    Thanked 8 Times in 8 Posts

    Default 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...


  2. #2
    Junior Member
    Join Date
    Aug 2011
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Java Networking Without Port Forwarding

    bump because I am interested in an answer to this as well

  3. #3
    Super Moderator Sean4u's Avatar
    Join Date
    Jul 2011
    Location
    Tavistock, UK
    Posts
    637
    Thanks
    5
    Thanked 103 Times in 93 Posts

    Default 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.
    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.

  4. #4
    Member
    Join Date
    Jun 2011
    Posts
    182
    My Mood
    Where
    Thanks
    15
    Thanked 8 Times in 8 Posts

    Default Re: Java Networking Without Port Forwarding

    Quote Originally Posted by Sean4u View Post
    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.

  5. #5
    Super Moderator Sean4u's Avatar
    Join Date
    Jul 2011
    Location
    Tavistock, UK
    Posts
    637
    Thanks
    5
    Thanked 103 Times in 93 Posts

    Default Re: Java Networking Without Port Forwarding

    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.

Similar Threads

  1. Relay data from remote port to local port
    By chegers in forum Java Networking
    Replies: 0
    Last Post: November 7th, 2010, 12:46 PM
  2. networking in java
    By sridhar in forum Member Introductions
    Replies: 1
    Last Post: October 4th, 2010, 11:11 AM
  3. [SOLVED] java networking
    By renu1 in forum Java Networking
    Replies: 0
    Last Post: March 12th, 2010, 12:33 PM
  4. advanced java networking help/theory
    By wolfgar in forum Java Theory & Questions
    Replies: 2
    Last Post: February 7th, 2010, 07:02 PM
  5. theory about serial / parallel port & java
    By wolfgar in forum Java Theory & Questions
    Replies: 5
    Last Post: January 4th, 2010, 10:08 PM