P2P NAT Sample

Overview of the P2P NAT Sample


The P2P NAT sample demonstrates Peer-To-Peer communication between users using NAT-traversal via the P2P Interface. To help determine if the user can easily connect to peers, the P2P Interface can query the local user's NAT Type in relation to the internet, the sample shows this status for the logged in user.

Before You Begin

The sample application uses Epic Account Services to authenticate the local user for demonstration purposes. This requires that the Client Credentials used to initialize the SDK have been assigned to an Application used for Epic Account Services.

The demonstrated SDK functionality can be used with any of the supported identity providers for user authentication.

NAT Status

After logging in you will see one of the following NAT Status states shown:

NAT Status





NAT type either unknown (remote) or we are unable to determine it (local).



All peers can directly-connect to you.



You can directly-connect to other Moderate and Open peers.



You can only directly-connect to Open peers.


To illustrate communication between users there is a basic chat system included with this sample to allow you to attempt to send and receive messages between users. To attempt to initiate a chat with a friend, click on the "CHAT" button next to their name in the friends section as shown below:


To chat click on the chat box (above the console) and type a message then hit ENTER to send the chat message as shown below:


The messages sent by you and received from friends will appear in the box in the top-left as shown below:


To close the current chat session, click on the "CLOSE CHAT" button.


To find out more information about NAT Traversal and P2P communication click on the "DOCUMENTATION" button, a new web browser link will open. You may also refer to the P2P Interface page.