{{title}}

Status: NO-STATUS

The socket example demonstrates how to use the TCP and UDP socket API.
This API is normally only available to packaged apps with the requisite socket permission, but can be enabled for debugging purposes using the --allow-nacl-socket-api=<hostname> command line flag.
First set a server address in the form of 'hostname:port', then push the "Connect" button to establish a connection.
"Send" button sends the message of the text area to the the remote host. Any data received back will be output to the status log.
For example, try connecting to a TCP echo server that will reply with whatever bytes you send, or connect to a web server and send a GET request.
"Close" button closes the connection.

Create a local server:

The "Listen" button can be used create a local TCP or UDP echo server listenting on the port specified. Once started this server can be connected to by entering localhost:<port>
above.

Port: