PHP Classes
elePHPant
Icontem

PHP UDP Hole Punching: Connect to network peers through a UDP server

Recommend this page to a friend!
  Info   View files Example   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2016-08-14 (2 months ago) RSS 2.0 feedNot enough user ratingsTotal: 159 This week: 4All time: 8,116 This week: 267Up
Version License PHP version Categories
php-hole-puncing 1.0.0Artistic License5Networking, PHP 5, P2P
Description Author

This package can be used to connect to network peers through a UDP server.

There is a client class that sends UDP packets to a server listening to a given port on a given IP address to request the list of other network clients that connected to the server.

The server class returns the list of IP addresses and ports of connected clients and sends another UDP message to IP address and port of each client.

The server also keeps sending ping packets to determine if each client is still connected.

Innovation Award
PHP Programming Innovation award nominee
August 2016
Number 7


Prize: One ebook of choice by Packt
When you want to connect to a remote machine that is connected to a group of peers but you do not know its address, one common solution is to connect to central server and ask the addresses of the peers to communicate with them.

This technique is used by NAT servers (Network Address Translators) that are often running on router machines in order to route requests to remote machines from local network computers.

This process is called hole punching because it uses an intermediary server to get the addresses of the remote machines, so the client can communicate with them.

This PHP package implements a server with one class that can keeps the list of connected client machines and returns the list of peer addresses and ports.

The client class connects to the server class to get the peer machine address list, so it can send messages to them using UDP packets.

Manuel Lemos
Picture of Nick Daniels
  Performance   Level  
Name: Nick Daniels <contact>
Classes: 13 packages by
Country: United States United States
Innovation award
Innovation award
Nominee: 4x

Winner: 1x

  Files folder image Files  
File Role Description
Plain text file client.class.php Class Client Class
Accessible without login Plain text file client.example.php Example Client Example
Plain text file cloud.class.php Class Cloud/Server Class
Accessible without login Plain text file cloud.example.php Example Cloud/Server Example

 Version Control Unique User Downloads Download Rankings  
 0%
Total:159
This week:4
All time:8,116
This week:267Up