hole-punching

Java-Client PHP-Server UDP Hole Punching example code

北战南征 提交于 2019-12-02 01:00:55
I'm working on a project that will require ea p2p server, but I haven't found any java-client php-server example code. I understand the concept of how udp hole punching works but I can't get anything to work in code. What I've tried: TheSocket.java public class TheSocket { public static String response = "hello"; public static String request; public static String webServerAddress; public static ServerSocket s; protected static ServerSocket getServerSocket(int port)throws Exception{ return new ServerSocket(port); } public static void handleRequest(Socket s){ BufferedReader is; PrintWriter os;

UDP hole punching host-specific failure

走远了吗. 提交于 2019-12-01 22:21:08
I wrote a program that sets-up peer-to-peer links. The programm, which can be found at http://basyl.co.uk/code/punch/doc/files/Readme-txt.html , is in two parts: a server that runs on a public host; and a client that is used by each end of the desired peer-to-peer link. I have access to two public servers: 'bonn' (home.contextshift.co.uk) and 'entropy' (home2.contextshift.co.uk) If the server is on bonn and clients are run on bonn, entropy and my home PC (behind NAT), a punched connection from entropy can talk to my PC without problem. However, a connection from bonn to the PC fails; data from

UDP Hole Punching Algorithm

筅森魡賤 提交于 2019-11-30 00:21:27
Can anyone give an example of a UDP Hole Punching ? Actually, I want to write a chat program with which people can chat when they know each other's IP. But both the machines will be behind a firewalled router. So, I need to punch a hole in order to communicate. I would like a function such that on calling the function, a hole would have been punched and future communications would move on easily - if that's not too much to ask for :) Short Answer: it can't be done reliably. Long Answer: "Hole Punching" refers to triggering automatic NAT rules of a router in order to allow inbound traffic. When

UDP hole punching. Have server talk to client

独自空忆成欢 提交于 2019-11-29 02:56:58
问题 I been reading a lot on how to implement UDP hole punching but fore some reason I cannot make it work. For those that are not familiar of what udp hole punching is here is my own definition: The goal is to be able to transfer data between two clients (Client A and client B) with the help of a server. So client A connects to the server and sends its info. Client B does the same. The server has the nessesary info so that Client A is able to send data to Client B and vise versa . Therefore the

UDP Hole Punching Java Example

被刻印的时光 ゝ 提交于 2019-11-29 01:23:52
问题 I want to do UDP Hole Punching with two clients with the help of a server with a static IP. The server waits for the two clients on port 7070 and 7071. After that it sends the IP address and port to each other. This part is working fine. But I'm not able to establish a communication between the two clients. I tried the code in different Wifi networks and in 3G mobile network. The client program throws the IO-Exception "No route to host". The client code is used for both clients. Once executed

TCP Hole Punching

若如初见. 提交于 2019-11-28 16:54:22
I'm trying to implement TCP hole punching with windows socket using mingw toolchain. I think the process is right but the hole doesn't seems to take. I used this as reference. A and B connect to the server S S sends to A , B 's router IP + the port it used to connect to S S does the same for B A start 2 threads: One thread tries connecting to B 's router with the info sent by S The other thread is waiting for an incoming connection on the same port used to connect to its router when it connected to S B does the same I have no issue in the code I think since: A and B does get each other ip and

Java UDP hole punching example - connecting through firewall

倖福魔咒の 提交于 2019-11-28 14:10:23
问题 Lets say I have two computers. They know each others public and private IPs via ice4j . One client listening and the other one sending some string. I'd like to see this happen via UPD hole punching: Let A be the client requesting the connection Let B be the client that is responding to the request Let S be the ice4j STUN server that they contact to initiate the connection -- A sends a connection request to S S responds with B's IP and port info, and sends A's IP and port info to B A sends a

UDP hole punching implementation

我与影子孤独终老i 提交于 2019-11-28 03:29:43
I am trying to accomplish UDP hole punching. I am basing my theory on this article and this WIKI page , but I am facing some issues with the C# coding of it. Here is my problem: Using the code that was posted here I am now able to connect to a remote machine and listen on the same port for incoming connections (Bind 2 UDP clients to the same port). For some reason the two bindings to the same port block each other from receiving any data. I have a UDP server that responds to my connection so if I connect to it first before binding any other client to the port I get its responses back. If I

TCP Hole Punching

蹲街弑〆低调 提交于 2019-11-27 10:02:07
问题 I'm trying to implement TCP hole punching with windows socket using mingw toolchain. I think the process is right but the hole doesn't seems to take. I used this as reference. A and B connect to the server S S sends to A , B 's router IP + the port it used to connect to S S does the same for B A start 2 threads: One thread tries connecting to B 's router with the info sent by S The other thread is waiting for an incoming connection on the same port used to connect to its router when it

Trying get dynamic content hole-punched through Magento's Full Page Cache

时光毁灭记忆、已成空白 提交于 2019-11-26 20:44:11
问题 I am using Magento Enterprise 1.10.1.1 and need to get some dynamic content on our product pages. I am inserting the current time in a block to quickly see if it is working, but can't seem to get through full page cache. I have tried a variety of implementations found here: http://tweetorials.tumblr.com/post/10160075026/ee-full-page-cache-hole-punching http://oggettoweb.com/blog/customizations-compatible-magento-full-page-cache/ http://magentophp.blogspot.com/2011/02/magento-enterprise-full