A Secure WebSocket client example that shows how to use the WebSocket library in SharkSSL-Lite

Dependencies:   EthernetInterface SharkSSL-Lite mbed-rtos mbed

The example connects to an online echo service and requires that you connect a terminal via the ''mbed Serial Port'. Windows users must install the Windows serial port driver.

The following screenshot shows Putty connected to the mbed serial terminal and after entering a few lines of text.

/media/uploads/wini/websocket-example.png

main.cpp

Committer:
wini
Date:
2016-04-06
Revision:
0:3a00a9689a7e

File content as of revision 0:3a00a9689a7e:

#include "mbed.h"
#include "EthernetInterface.h"
#include <selib.h>

int main() {
    EthernetInterface eth;
    eth.init(); //Use DHCP
    eth.connect();
    printf("IP Address is %s\n", eth.getIPAddress());
   mainTask(0);
   error("mainTask returned");
}