blob: 2f14e174d5025c5bc85da9a3f2eecd680ba091de [file] [log] [blame]
Andy Greenb2149772010-10-31 13:15:56 +00001Using test-server as a quickstart
2---------------------------------
3
Andy Greena1e3ec02010-11-08 17:16:50 +00004For a Fedora x86_86 box, the following config line was
5needed:
6
7./configure --prefix=/usr --libdir=/usr/lib64 --enable-openssl
8
9otherwise if /usr/local/... and /usr/local/lib are OK then...
10
Andy Green3c974692010-11-08 17:04:09 +000011$ ./configure --enable-openssl
Andy Green05a0a7b2010-10-31 17:51:39 +000012$ make
Andy Green7310e9c2010-11-01 09:12:17 +000013$ sudo make install
14$ libwebsockets-test-server
Andy Greenb2149772010-10-31 13:15:56 +000015
16should be enough to get a test server listening on port 7861.
17
18If you point your browser (eg, Chrome) to
19
20 http://127.0.0.1:7681
21
Andy Green3c974692010-11-08 17:04:09 +000022It will fetch a script in the form of test.html, and then run the
Andy Green7310e9c2010-11-01 09:12:17 +000023script in there on the browser to open a websocket connection.
24Incrementing numbers should appear in the browser display.
Andy Greenb2149772010-10-31 13:15:56 +000025
Andy Green3c974692010-11-08 17:04:09 +000026To test it using SSL/WSS, just run the test server with
27
28$ libwebsockets-test-server --ssl
29
30and use the URL
31
32 https://127.0.0.1:7681
33
34The connection will be entirely encrypted using some generated
35certificates that your browser will not accept, since they are
36not signed by any real Certificate Authority. Just accept the
37certificates in the browser and the connection will proceed
38in first https and then websocket wss, acting exactly the
39same.
40
Andy Greenb2149772010-10-31 13:15:56 +000041test-server.c is all that is needed to use libwebsockets for
42serving both the script html over http and websockets.
43
Andy Green3c974692010-11-08 17:04:09 +0000442010-11-08 Andy Green <andy@warmcat.com>
Andy Greenb2149772010-10-31 13:15:56 +000045