add-enable-nofork-config-option.patch
[profile/ivi/libwebsockets.git] / README-test-server
1 Using test-server as a quickstart
2 ---------------------------------
3
4 For a Fedora x86_86 box, the following config line was
5 needed:
6
7 ./configure --prefix=/usr --libdir=/usr/lib64 --enable-openssl
8
9 otherwise if /usr/local/... and /usr/local/lib are OK then...
10
11 $ ./configure --enable-openssl
12 $ make
13 $ sudo make install
14 $ libwebsockets-test-server
15
16 should be enough to get a test server listening on port 7861.
17
18 Testing
19 -------
20
21 If you point your browser (eg, Chrome) to
22
23   http://127.0.0.1:7681
24
25 It will fetch a script in the form of test.html, and then run the
26 script in there on the browser to open a websocket connection.
27 Incrementing numbers should appear in the browser display.
28
29 Using SSL
30 ---------
31
32 To test it using SSL/WSS, just run the test server with
33
34 $ libwebsockets-test-server --ssl
35
36 and use the URL
37
38   https://127.0.0.1:7681
39
40 The connection will be entirely encrypted using some generated
41 certificates that your browser will not accept, since they are
42 not signed by any real Certificate Authority.  Just accept the
43 certificates in the browser and the connection will proceed
44 in first https and then websocket wss, acting exactly the
45 same.
46
47 test-server.c is all that is needed to use libwebsockets for
48 serving both the script html over http and websockets.
49
50 Forkless operation
51 ------------------
52
53 If your target device does not offer fork(), you can use
54 libwebsockets from your own main loop instead.  Use the
55 configure option --nofork and simply call libwebsocket_service()
56 from your own main loop as shown in the test app sources.
57
58
59 Websocket version supported
60 ---------------------------
61
62 Right now this is tested and working on websockets protocol 76/00
63 Untested code is in for 04 support, there is no browser support
64 available yet to test it with.  Libwebsockets should autoselect
65 between the supported versions according to what the browser
66 asks for.
67
68 2011-01-20  Andy Green <andy@warmcat.com>
69