2010-10-31 13:15:56 +00:00
|
|
|
Using test-server as a quickstart
|
|
|
|
---------------------------------
|
|
|
|
|
2010-11-08 17:16:50 +00:00
|
|
|
For a Fedora x86_86 box, the following config line was
|
|
|
|
needed:
|
|
|
|
|
|
|
|
./configure --prefix=/usr --libdir=/usr/lib64 --enable-openssl
|
|
|
|
|
|
|
|
otherwise if /usr/local/... and /usr/local/lib are OK then...
|
|
|
|
|
2010-11-08 17:04:09 +00:00
|
|
|
$ ./configure --enable-openssl
|
2010-10-31 17:51:39 +00:00
|
|
|
$ make
|
2010-11-01 09:12:17 +00:00
|
|
|
$ sudo make install
|
|
|
|
$ libwebsockets-test-server
|
2010-10-31 13:15:56 +00:00
|
|
|
|
|
|
|
should be enough to get a test server listening on port 7861.
|
|
|
|
|
|
|
|
If you point your browser (eg, Chrome) to
|
|
|
|
|
|
|
|
http://127.0.0.1:7681
|
|
|
|
|
2010-11-08 17:04:09 +00:00
|
|
|
It will fetch a script in the form of test.html, and then run the
|
2010-11-01 09:12:17 +00:00
|
|
|
script in there on the browser to open a websocket connection.
|
|
|
|
Incrementing numbers should appear in the browser display.
|
2010-10-31 13:15:56 +00:00
|
|
|
|
2010-11-08 17:04:09 +00:00
|
|
|
To test it using SSL/WSS, just run the test server with
|
|
|
|
|
|
|
|
$ libwebsockets-test-server --ssl
|
|
|
|
|
|
|
|
and use the URL
|
|
|
|
|
|
|
|
https://127.0.0.1:7681
|
|
|
|
|
|
|
|
The connection will be entirely encrypted using some generated
|
|
|
|
certificates that your browser will not accept, since they are
|
|
|
|
not signed by any real Certificate Authority. Just accept the
|
|
|
|
certificates in the browser and the connection will proceed
|
|
|
|
in first https and then websocket wss, acting exactly the
|
|
|
|
same.
|
|
|
|
|
2010-10-31 13:15:56 +00:00
|
|
|
test-server.c is all that is needed to use libwebsockets for
|
|
|
|
serving both the script html over http and websockets.
|
|
|
|
|
2010-11-08 17:04:09 +00:00
|
|
|
2010-11-08 Andy Green <andy@warmcat.com>
|
2010-10-31 13:15:56 +00:00
|
|
|
|