blob: 2184f162f77f7f760dfea908af87b39c53c1551f [file] [log] [blame]
Andy Green6964bb52011-01-23 16:50:33 +00001<h2>libwebsocket_context_destroy - Destroy the websocket context</h2>
2<i>void</i>
3<b>libwebsocket_context_destroy</b>
4(<i>struct libwebsocket_context *</i> <b>this</b>)
5<h3>Arguments</h3>
6<dl>
7<dt><b>this</b>
8<dd>Websocket context
9</dl>
10<h3>Description</h3>
11<blockquote>
12This function closes any active connections and then frees the
13context. After calling this, any further use of the context is
14undefined.
15</blockquote>
16<hr>
17<h2>libwebsocket_service - Service any pending websocket activity</h2>
18<i>int</i>
19<b>libwebsocket_service</b>
20(<i>struct libwebsocket_context *</i> <b>this</b>,
21<i>int</i> <b>timeout_ms</b>)
22<h3>Arguments</h3>
23<dl>
24<dt><b>this</b>
25<dd>Websocket context
26<dt><b>timeout_ms</b>
27<dd>Timeout for poll; 0 means return immediately if nothing needed
28service otherwise block and service immediately, returning
29after the timeout if nothing needed service.
30</dl>
31<h3>Description</h3>
32<blockquote>
33This function deals with any pending websocket traffic, for three
34kinds of event. It handles these events on both server and client
35types of connection the same.
36<p>
371) Accept new connections to our context's server
38<p>
392) Perform pending broadcast writes initiated from other forked
40processes (effectively serializing asynchronous broadcasts)
41<p>
423) Call the receive callback for incoming frame data received by
43server or client connections.
44<p>
45You need to call this service function periodically to all the above
46functions to happen; if your application is single-threaded you can
47just call it in your main event loop.
48<p>
49Alternatively you can fork a new process that asynchronously handles
50calling this service in a loop. In that case you are happy if this
51call blocks your thread until it needs to take care of something and
52would call it with a large nonzero timeout. Your loop then takes no
53CPU while there is nothing happening.
54<p>
55If you are calling it in a single-threaded app, you don't want it to
56wait around blocking other things in your loop from happening, so you
57would call it with a timeout_ms of 0, so it returns immediately if
58nothing is pending, or as soon as it services whatever was pending.
59</blockquote>
60<hr>
Andy Green90c7cbc2011-01-27 06:26:52 +000061<h2>libwebsocket_callback_on_writable - Request a callback when this socket becomes able to be written to without blocking</h2>
62<i>int</i>
63<b>libwebsocket_callback_on_writable</b>
64(<i>struct libwebsocket *</i> <b>wsi</b>)
65<h3>Arguments</h3>
66<dl>
67<dt><b>wsi</b>
68<dd>Websocket connection instance to get callback for
69</dl>
Andy Green0d338332011-02-12 11:57:43 +000070<h3>Description</h3>
71<blockquote>
72<p>
73This only works for internal <b>poll</b> management, (ie, calling the libwebsocket
74service loop, you will have to make your own arrangements if your <b>poll</b>
75loop is managed externally.
76</blockquote>
Andy Green90c7cbc2011-01-27 06:26:52 +000077<hr>
78<h2>libwebsocket_callback_on_writable_all_protocol - Request a callback for all connections using the given protocol when it becomes possible to write to each socket without blocking in turn.</h2>
79<i>int</i>
80<b>libwebsocket_callback_on_writable_all_protocol</b>
81(<i>const struct libwebsocket_protocols *</i> <b>protocol</b>)
82<h3>Arguments</h3>
83<dl>
84<dt><b>protocol</b>
85<dd>Protocol whose connections will get callbacks
86</dl>
Andy Green0d338332011-02-12 11:57:43 +000087<h3>Description</h3>
88<blockquote>
89<p>
90This only works for internal <b>poll</b> management, (ie, calling the libwebsocket
91service loop, you will have to make your own arrangements if your <b>poll</b>
92loop is managed externally.
93</blockquote>
Andy Green90c7cbc2011-01-27 06:26:52 +000094<hr>
Andy Greena6cbece2011-01-27 20:06:03 +000095<h2>libwebsocket_get_socket_fd - returns the socket file descriptor</h2>
96<i>int</i>
97<b>libwebsocket_get_socket_fd</b>
98(<i>struct libwebsocket *</i> <b>wsi</b>)
99<h3>Arguments</h3>
100<dl>
101<dt><b>wsi</b>
102<dd>Websocket connection instance
103</dl>
104<h3>Description</h3>
105<blockquote>
106<p>
107You will not need this unless you are doing something special
108</blockquote>
109<hr>
Andy Green90c7cbc2011-01-27 06:26:52 +0000110<h2>libwebsocket_rx_flow_control - Enable and disable socket servicing for receieved packets.</h2>
111<i>int</i>
112<b>libwebsocket_rx_flow_control</b>
113(<i>struct libwebsocket *</i> <b>wsi</b>,
114<i>int</i> <b>enable</b>)
115<h3>Arguments</h3>
116<dl>
117<dt><b>wsi</b>
118<dd>Websocket connection instance to get callback for
119<dt><b>enable</b>
120<dd>0 = disable read servicing for this connection, 1 = enable
121</dl>
122<h3>Description</h3>
123<blockquote>
124<p>
125If the output side of a server process becomes choked, this allows flow
126control for the input side.
Andy Green0d338332011-02-12 11:57:43 +0000127<p>
128This only works for internal <b>poll</b> management, (ie, calling the libwebsocket
129service loop, you will have to make your own arrangements if your <b>poll</b>
130loop is managed externally.
Andy Green90c7cbc2011-01-27 06:26:52 +0000131</blockquote>
132<hr>
Andy Green2ac5a6f2011-01-28 10:00:18 +0000133<h2>libwebsocket_canonical_hostname - returns this host's hostname</h2>
134<i>const char *</i>
135<b>libwebsocket_canonical_hostname</b>
136(<i>struct libwebsocket_context *</i> <b>this</b>)
137<h3>Arguments</h3>
138<dl>
139<dt><b>this</b>
140<dd>Websocket context
141</dl>
142<h3>Description</h3>
143<blockquote>
144<p>
145This is typically used by client code to fill in the host parameter
146when making a client connection. You can only call it after the context
147has been created.
148</blockquote>
149<hr>
Andy Green4739e5c2011-01-22 12:51:57 +0000150<h2>libwebsocket_create_context - Create the websocket handler</h2>
Andy Greene92cd172011-01-19 13:11:55 +0000151<i>struct libwebsocket_context *</i>
Andy Green4739e5c2011-01-22 12:51:57 +0000152<b>libwebsocket_create_context</b>
Andy Green62a12932010-11-03 11:19:23 +0000153(<i>int</i> <b>port</b>,
Andy Greenb45993c2010-12-18 15:13:50 +0000154<i>struct libwebsocket_protocols *</i> <b>protocols</b>,
Andy Green3faa9c72010-11-08 17:03:03 +0000155<i>const char *</i> <b>ssl_cert_filepath</b>,
156<i>const char *</i> <b>ssl_private_key_filepath</b>,
157<i>int</i> <b>gid</b>,
Andy Green8014b292011-01-30 20:57:25 +0000158<i>int</i> <b>uid</b>,
159<i>unsigned int</i> <b>options</b>)
Andy Green62a12932010-11-03 11:19:23 +0000160<h3>Arguments</h3>
161<dl>
162<dt><b>port</b>
Andy Green4739e5c2011-01-22 12:51:57 +0000163<dd>Port to listen on... you can use 0 to suppress listening on
164any port, that's what you want if you are not running a
165websocket server at all but just using it as a client
Andy Green4f3943a2010-11-12 10:44:16 +0000166<dt><b>protocols</b>
167<dd>Array of structures listing supported protocols and a protocol-
168specific callback for each one. The list is ended with an
169entry that has a NULL callback pointer.
Andy Greenb45993c2010-12-18 15:13:50 +0000170It's not const because we write the owning_server member
Andy Green3faa9c72010-11-08 17:03:03 +0000171<dt><b>ssl_cert_filepath</b>
172<dd>If libwebsockets was compiled to use ssl, and you want
173to listen using SSL, set to the filepath to fetch the
174server cert from, otherwise NULL for unencrypted
175<dt><b>ssl_private_key_filepath</b>
176<dd>filepath to private key if wanting SSL mode,
177else ignored
178<dt><b>gid</b>
179<dd>group id to change to after setting listen socket, or -1.
180<dt><b>uid</b>
181<dd>user id to change to after setting listen socket, or -1.
Andy Greenbfb051f2011-02-09 08:49:14 +0000182<dt><b>options</b>
183<dd>0, or LWS_SERVER_OPTION_DEFEAT_CLIENT_MASK
Andy Green62a12932010-11-03 11:19:23 +0000184</dl>
185<h3>Description</h3>
186<blockquote>
Andy Green47943ae2010-11-12 11:15:49 +0000187This function creates the listening socket and takes care
Andy Green62a12932010-11-03 11:19:23 +0000188of all initialization in one step.
189<p>
Andy Greene92cd172011-01-19 13:11:55 +0000190After initialization, it returns a struct libwebsocket_context * that
191represents this server. After calling, user code needs to take care
192of calling <b>libwebsocket_service</b> with the context pointer to get the
193server's sockets serviced. This can be done in the same process context
194or a forked process, or another thread,
Andy Green47943ae2010-11-12 11:15:49 +0000195<p>
196The protocol callback functions are called for a handful of events
197including http requests coming in, websocket connections becoming
Andy Green62a12932010-11-03 11:19:23 +0000198established, and data arriving; it's also called periodically to allow
199async transmission.
200<p>
Andy Green47943ae2010-11-12 11:15:49 +0000201HTTP requests are sent always to the FIRST protocol in <tt><b>protocol</b></tt>, since
202at that time websocket protocol has not been negotiated. Other
203protocols after the first one never see any HTTP callack activity.
204<p>
Andy Green62a12932010-11-03 11:19:23 +0000205The server created is a simple http server by default; part of the
206websocket standard is upgrading this http connection to a websocket one.
207<p>
208This allows the same server to provide files like scripts and favicon /
209images or whatever over http and dynamic data over websockets all in
210one place; they're all handled in the user callback.
211</blockquote>
212<hr>
Andy Greene92cd172011-01-19 13:11:55 +0000213<h2>libwebsockets_fork_service_loop - Optional helper function forks off a process for the websocket server loop. You don't have to use this but if not, you have to make sure you are calling libwebsocket_service periodically to service the websocket traffic</h2>
214<i>int</i>
215<b>libwebsockets_fork_service_loop</b>
216(<i>struct libwebsocket_context *</i> <b>this</b>)
217<h3>Arguments</h3>
218<dl>
219<dt><b>this</b>
220<dd>server context returned by creation function
221</dl>
222<hr>
Andy Greenb45993c2010-12-18 15:13:50 +0000223<h2>libwebsockets_get_protocol - Returns a protocol pointer from a websocket connection.</h2>
224<i>const struct libwebsocket_protocols *</i>
225<b>libwebsockets_get_protocol</b>
226(<i>struct libwebsocket *</i> <b>wsi</b>)
227<h3>Arguments</h3>
228<dl>
229<dt><b>wsi</b>
230<dd>pointer to struct websocket you want to know the protocol of
231</dl>
232<h3>Description</h3>
233<blockquote>
234<p>
235This is useful to get the protocol to broadcast back to from inside
236the callback.
237</blockquote>
238<hr>
Andy Greene92cd172011-01-19 13:11:55 +0000239<h2>libwebsockets_broadcast - Sends a buffer to the callback for all active connections of the given protocol.</h2>
Andy Greenb45993c2010-12-18 15:13:50 +0000240<i>int</i>
241<b>libwebsockets_broadcast</b>
242(<i>const struct libwebsocket_protocols *</i> <b>protocol</b>,
243<i>unsigned char *</i> <b>buf</b>,
244<i>size_t</i> <b>len</b>)
245<h3>Arguments</h3>
246<dl>
247<dt><b>protocol</b>
248<dd>pointer to the protocol you will broadcast to all members of
249<dt><b>buf</b>
250<dd>buffer containing the data to be broadcase. NOTE: this has to be
251allocated with LWS_SEND_BUFFER_PRE_PADDING valid bytes before
252the pointer and LWS_SEND_BUFFER_POST_PADDING afterwards in the
253case you are calling this function from callback context.
254<dt><b>len</b>
255<dd>length of payload data in buf, starting from buf.
256</dl>
257<h3>Description</h3>
258<blockquote>
259This function allows bulk sending of a packet to every connection using
260the given protocol. It does not send the data directly; instead it calls
261the callback with a reason type of LWS_CALLBACK_BROADCAST. If the callback
262wants to actually send the data for that connection, the callback itself
263should call <b>libwebsocket_write</b>.
264<p>
265<b>libwebsockets_broadcast</b> can be called from another fork context without
266having to take any care about data visibility between the processes, it'll
267"just work".
268</blockquote>
269<hr>
Andy Green62a12932010-11-03 11:19:23 +0000270<h2>libwebsocket_write - Apply protocol then write data to client</h2>
271<i>int</i>
272<b>libwebsocket_write</b>
273(<i>struct libwebsocket *</i> <b>wsi</b>,
274<i>unsigned char *</i> <b>buf</b>,
275<i>size_t</i> <b>len</b>,
276<i>enum libwebsocket_write_protocol</i> <b>protocol</b>)
277<h3>Arguments</h3>
278<dl>
279<dt><b>wsi</b>
280<dd>Websocket instance (available from user callback)
281<dt><b>buf</b>
282<dd>The data to send. For data being sent on a websocket
283connection (ie, not default http), this buffer MUST have
284LWS_SEND_BUFFER_PRE_PADDING bytes valid BEFORE the pointer
285and an additional LWS_SEND_BUFFER_POST_PADDING bytes valid
286in the buffer after (buf + len). This is so the protocol
287header and trailer data can be added in-situ.
288<dt><b>len</b>
289<dd>Count of the data bytes in the payload starting from buf
290<dt><b>protocol</b>
291<dd>Use LWS_WRITE_HTTP to reply to an http connection, and one
292of LWS_WRITE_BINARY or LWS_WRITE_TEXT to send appropriate
293data on a websockets connection. Remember to allow the extra
294bytes before and after buf if LWS_WRITE_BINARY or LWS_WRITE_TEXT
295are used.
296</dl>
297<h3>Description</h3>
298<blockquote>
299This function provides the way to issue data back to the client
300for both http and websocket protocols.
301<p>
302In the case of sending using websocket protocol, be sure to allocate
303valid storage before and after buf as explained above. This scheme
304allows maximum efficiency of sending data and protocol in a single
305packet while not burdening the user code with any protocol knowledge.
306</blockquote>
307<hr>
308<h2>libwebsockets_serve_http_file - Send a file back to the client using http</h2>
309<i>int</i>
310<b>libwebsockets_serve_http_file</b>
311(<i>struct libwebsocket *</i> <b>wsi</b>,
312<i>const char *</i> <b>file</b>,
313<i>const char *</i> <b>content_type</b>)
314<h3>Arguments</h3>
315<dl>
316<dt><b>wsi</b>
317<dd>Websocket instance (available from user callback)
318<dt><b>file</b>
319<dd>The file to issue over http
320<dt><b>content_type</b>
321<dd>The http content type, eg, text/html
322</dl>
323<h3>Description</h3>
324<blockquote>
325This function is intended to be called from the callback in response
326to http requests from the client. It allows the callback to issue
327local files down the http link in a single step.
328</blockquote>
329<hr>
Andy Green38e57bb2011-01-19 12:20:27 +0000330<h2>libwebsockets_remaining_packet_payload - Bytes to come before "overall" rx packet is complete</h2>
331<i>size_t</i>
332<b>libwebsockets_remaining_packet_payload</b>
333(<i>struct libwebsocket *</i> <b>wsi</b>)
334<h3>Arguments</h3>
335<dl>
336<dt><b>wsi</b>
337<dd>Websocket instance (available from user callback)
338</dl>
339<h3>Description</h3>
340<blockquote>
341This function is intended to be called from the callback if the
342user code is interested in "complete packets" from the client.
343libwebsockets just passes through payload as it comes and issues a buffer
344additionally when it hits a built-in limit. The LWS_CALLBACK_RECEIVE
345callback handler can use this API to find out if the buffer it has just
346been given is the last piece of a "complete packet" from the client --
347when that is the case <b>libwebsockets_remaining_packet_payload</b> will return
3480.
349<p>
350Many protocols won't care becuse their packets are always small.
351</blockquote>
352<hr>
Andy Green90c7cbc2011-01-27 06:26:52 +0000353<h2>libwebsocket_client_connect - Connect to another websocket server</h2>
354<i>struct libwebsocket *</i>
355<b>libwebsocket_client_connect</b>
356(<i>struct libwebsocket_context *</i> <b>this</b>,
357<i>const char *</i> <b>address</b>,
358<i>int</i> <b>port</b>,
359<i>int</i> <b>ssl_connection</b>,
360<i>const char *</i> <b>path</b>,
361<i>const char *</i> <b>host</b>,
362<i>const char *</i> <b>origin</b>,
Andy Greenbfb051f2011-02-09 08:49:14 +0000363<i>const char *</i> <b>protocol</b>,
364<i>int</i> <b>ietf_version_or_minus_one</b>)
Andy Green90c7cbc2011-01-27 06:26:52 +0000365<h3>Arguments</h3>
366<dl>
367<dt><b>this</b>
368<dd>Websocket context
369<dt><b>address</b>
370<dd>Remote server address, eg, "myserver.com"
371<dt><b>port</b>
372<dd>Port to connect to on the remote server, eg, 80
373<dt><b>ssl_connection</b>
374<dd>0 = ws://, 1 = wss:// encrypted, 2 = wss:// allow self
375signed certs
376<dt><b>path</b>
377<dd>Websocket path on server
378<dt><b>host</b>
379<dd>Hostname on server
380<dt><b>origin</b>
381<dd>Socket origin name
382<dt><b>protocol</b>
383<dd>Comma-separated list of protocols being asked for from
384the server, or just one. The server will pick the one it
385likes best.
Andy Greenbfb051f2011-02-09 08:49:14 +0000386<dt><b>ietf_version_or_minus_one</b>
387<dd>-1 to ask to connect using the default, latest
388protocol supported, or the specific protocol ordinal
Andy Green90c7cbc2011-01-27 06:26:52 +0000389</dl>
390<h3>Description</h3>
391<blockquote>
392This function creates a connection to a remote server
393</blockquote>
394<hr>
Andy Green8f037e42010-12-19 22:13:26 +0000395<h2>callback - User server actions</h2>
396<i>int</i>
397<b>callback</b>
398(<i>struct libwebsocket *</i> <b>wsi</b>,
399<i>enum libwebsocket_callback_reasons</i> <b>reason</b>,
400<i>void *</i> <b>user</b>,
401<i>void *</i> <b>in</b>,
402<i>size_t</i> <b>len</b>)
403<h3>Arguments</h3>
404<dl>
405<dt><b>wsi</b>
406<dd>Opaque websocket instance pointer
407<dt><b>reason</b>
408<dd>The reason for the call
409<dt><b>user</b>
410<dd>Pointer to per-session user data allocated by library
411<dt><b>in</b>
412<dd>Pointer used for some callback reasons
413<dt><b>len</b>
414<dd>Length set for some callback reasons
415</dl>
416<h3>Description</h3>
417<blockquote>
418This callback is the way the user controls what is served. All the
419protocol detail is hidden and handled by the library.
420<p>
421For each connection / session there is user data allocated that is
422pointed to by "user". You set the size of this user data area when
423the library is initialized with libwebsocket_create_server.
424<p>
425You get an opportunity to initialize user data when called back with
426LWS_CALLBACK_ESTABLISHED reason.
427</blockquote>
428<h3>LWS_CALLBACK_ESTABLISHED</h3>
429<blockquote>
Andy Green90c7cbc2011-01-27 06:26:52 +0000430after the server completes a handshake with
431an incoming client
432</blockquote>
433<h3>LWS_CALLBACK_CLIENT_ESTABLISHED</h3>
434<blockquote>
435after your client connection completed
436a handshake with the remote server
Andy Green8f037e42010-12-19 22:13:26 +0000437</blockquote>
438<h3>LWS_CALLBACK_CLOSED</h3>
439<blockquote>
440when the websocket session ends
441</blockquote>
442<h3>LWS_CALLBACK_BROADCAST</h3>
443<blockquote>
444signal to send to client (you would use
445<b>libwebsocket_write</b> taking care about the
446special buffer requirements
447</blockquote>
448<h3>LWS_CALLBACK_RECEIVE</h3>
449<blockquote>
Andy Green90c7cbc2011-01-27 06:26:52 +0000450data has appeared for this server endpoint from a
451remote client, it can be found at *in and is
452len bytes long
453</blockquote>
Andy Greena6cbece2011-01-27 20:06:03 +0000454<h3>LWS_CALLBACK_CLIENT_RECEIVE_PONG</h3>
455<blockquote>
456if you elected to see PONG packets,
457they appear with this callback reason. PONG
458packets only exist in 04+ protocol
459</blockquote>
Andy Green90c7cbc2011-01-27 06:26:52 +0000460<h3>LWS_CALLBACK_CLIENT_RECEIVE</h3>
461<blockquote>
462data has appeared from the server for the
463client connection, it can be found at *in and
464is len bytes long
Andy Green8f037e42010-12-19 22:13:26 +0000465</blockquote>
466<h3>LWS_CALLBACK_HTTP</h3>
467<blockquote>
468an http request has come from a client that is not
469asking to upgrade the connection to a websocket
470one. This is a chance to serve http content,
471for example, to send a script to the client
472which will then open the websockets connection.
Andy Green7619c472011-01-23 17:47:08 +0000473<tt><b>in</b></tt> points to the URI path requested and
Andy Green8f037e42010-12-19 22:13:26 +0000474<b>libwebsockets_serve_http_file</b> makes it very
475simple to send back a file to the client.
476</blockquote>
Andy Green90c7cbc2011-01-27 06:26:52 +0000477<h3>LWS_CALLBACK_CLIENT_WRITEABLE</h3>
478<blockquote>
479if you call
480<b>libwebsocket_callback_on_writable</b> on a connection, you will
481get this callback coming when the connection socket is able to
482accept another write packet without blocking. If it already
483was able to take another packet without blocking, you'll get
484this callback at the next call to the service loop function.
485</blockquote>
Andy Green8f037e42010-12-19 22:13:26 +0000486<hr>
Andy Green4f3943a2010-11-12 10:44:16 +0000487<h2>struct libwebsocket_protocols - List of protocols and handlers server supports.</h2>
488<b>struct libwebsocket_protocols</b> {<br>
489&nbsp; &nbsp; <i>const char *</i> <b>name</b>;<br>
Andy Greene77ddd82010-11-13 10:03:47 +0000490&nbsp; &nbsp; <i>int (*</i><b>callback</b>) <i>(struct libwebsocket *wsi,enum libwebsocket_callback_reasons reason, void *user,void *in, size_t len)</i>;<br>
Andy Green4f3943a2010-11-12 10:44:16 +0000491&nbsp; &nbsp; <i>size_t</i> <b>per_session_data_size</b>;<br>
Andy Greenb45993c2010-12-18 15:13:50 +0000492&nbsp; &nbsp; <i>struct libwebsocket_context *</i> <b>owning_server</b>;<br>
493&nbsp; &nbsp; <i>int</i> <b>broadcast_socket_port</b>;<br>
494&nbsp; &nbsp; <i>int</i> <b>broadcast_socket_user_fd</b>;<br>
495&nbsp; &nbsp; <i>int</i> <b>protocol_index</b>;<br>
Andy Green4f3943a2010-11-12 10:44:16 +0000496};<br>
497<h3>Members</h3>
498<dl>
499<dt><b>name</b>
500<dd>Protocol name that must match the one given in the client
501Javascript new WebSocket(url, 'protocol') name
502<dt><b>callback</b>
503<dd>The service callback used for this protocol. It allows the
504service action for an entire protocol to be encapsulated in
505the protocol-specific callback
506<dt><b>per_session_data_size</b>
507<dd>Each new connection using this protocol gets
508this much memory allocated on connection establishment and
509freed on connection takedown. A pointer to this per-connection
510allocation is passed into the callback in the 'user' parameter
Andy Greenb45993c2010-12-18 15:13:50 +0000511<dt><b>owning_server</b>
512<dd>the server init call fills in this opaque pointer when
513registering this protocol with the server.
514<dt><b>broadcast_socket_port</b>
515<dd>the server init call fills this in with the
516localhost port number used to forward broadcasts for this
517protocol
518<dt><b>broadcast_socket_user_fd</b>
519<dd>the server init call fills this in ... the <b>main</b>
520process context can write to this socket to perform broadcasts
521(use the <b>libwebsockets_broadcast</b> api to do this instead,
522it works from any process context)
523<dt><b>protocol_index</b>
524<dd>which protocol we are starting from zero
Andy Green4f3943a2010-11-12 10:44:16 +0000525</dl>
526<h3>Description</h3>
527<blockquote>
528This structure represents one protocol supported by the server. An
529array of these structures is passed to <b>libwebsocket_create_server</b>
530allows as many protocols as you like to be handled by one server.
531</blockquote>
532<hr>