blob: c67692a6074ce33043462b95826fc3566eb3854c [file] [log] [blame]
Andy Greend88146d2013-01-22 12:40:35 +08001<h2>libwebsocket_client_connect - Connect to another websocket server</h2>
2<i>struct libwebsocket *</i>
3<b>libwebsocket_client_connect</b>
4(<i>struct libwebsocket_context *</i> <b>context</b>,
5<i>const char *</i> <b>address</b>,
6<i>int</i> <b>port</b>,
7<i>int</i> <b>ssl_connection</b>,
8<i>const char *</i> <b>path</b>,
9<i>const char *</i> <b>host</b>,
10<i>const char *</i> <b>origin</b>,
11<i>const char *</i> <b>protocol</b>,
12<i>int</i> <b>ietf_version_or_minus_one</b>)
13<h3>Arguments</h3>
14<dl>
15<dt><b>context</b>
16<dd>Websocket context
17<dt><b>address</b>
18<dd>Remote server address, eg, "myserver.com"
19<dt><b>port</b>
20<dd>Port to connect to on the remote server, eg, 80
21<dt><b>ssl_connection</b>
22<dd>0 = ws://, 1 = wss:// encrypted, 2 = wss:// allow self
23signed certs
24<dt><b>path</b>
25<dd>Websocket path on server
26<dt><b>host</b>
27<dd>Hostname on server
28<dt><b>origin</b>
29<dd>Socket origin name
30<dt><b>protocol</b>
31<dd>Comma-separated list of protocols being asked for from
32the server, or just one. The server will pick the one it
33likes best.
34<dt><b>ietf_version_or_minus_one</b>
35<dd>-1 to ask to connect using the default, latest
36protocol supported, or the specific protocol ordinal
37</dl>
38<h3>Description</h3>
39<blockquote>
40This function creates a connection to a remote server
41</blockquote>
42<hr>
43<h2>libwebsocket_client_connect_extended - Connect to another websocket server</h2>
44<i>struct libwebsocket *</i>
45<b>libwebsocket_client_connect_extended</b>
46(<i>struct libwebsocket_context *</i> <b>context</b>,
47<i>const char *</i> <b>address</b>,
48<i>int</i> <b>port</b>,
49<i>int</i> <b>ssl_connection</b>,
50<i>const char *</i> <b>path</b>,
51<i>const char *</i> <b>host</b>,
52<i>const char *</i> <b>origin</b>,
53<i>const char *</i> <b>protocol</b>,
54<i>int</i> <b>ietf_version_or_minus_one</b>,
55<i>void *</i> <b>userdata</b>)
56<h3>Arguments</h3>
57<dl>
58<dt><b>context</b>
59<dd>Websocket context
60<dt><b>address</b>
61<dd>Remote server address, eg, "myserver.com"
62<dt><b>port</b>
63<dd>Port to connect to on the remote server, eg, 80
64<dt><b>ssl_connection</b>
65<dd>0 = ws://, 1 = wss:// encrypted, 2 = wss:// allow self
66signed certs
67<dt><b>path</b>
68<dd>Websocket path on server
69<dt><b>host</b>
70<dd>Hostname on server
71<dt><b>origin</b>
72<dd>Socket origin name
73<dt><b>protocol</b>
74<dd>Comma-separated list of protocols being asked for from
75the server, or just one. The server will pick the one it
76likes best.
77<dt><b>ietf_version_or_minus_one</b>
78<dd>-1 to ask to connect using the default, latest
79protocol supported, or the specific protocol ordinal
80<dt><b>userdata</b>
81<dd>Pre-allocated user data
82</dl>
83<h3>Description</h3>
84<blockquote>
85This function creates a connection to a remote server
86</blockquote>
87<hr>
Andy Greenf7ee5492011-02-13 09:04:21 +000088<h2>libwebsockets_hangup_on_client - Server calls to terminate client connection</h2>
89<i>void</i>
90<b>libwebsockets_hangup_on_client</b>
Peter Hinz56885f32011-03-02 22:03:47 +000091(<i>struct libwebsocket_context *</i> <b>context</b>,
Andy Greenf7ee5492011-02-13 09:04:21 +000092<i>int</i> <b>fd</b>)
93<h3>Arguments</h3>
94<dl>
Peter Hinz56885f32011-03-02 22:03:47 +000095<dt><b>context</b>
Andy Greenf7ee5492011-02-13 09:04:21 +000096<dd>libwebsockets context
97<dt><b>fd</b>
98<dd>Connection socket descriptor
99</dl>
100<hr>
Andy Green07034092011-02-13 08:37:12 +0000101<h2>libwebsockets_get_peer_addresses - Get client address information</h2>
102<i>void</i>
103<b>libwebsockets_get_peer_addresses</b>
Andy Greenaaf0b9f2013-01-30 08:12:20 +0800104(<i>struct libwebsocket_context *</i> <b>context</b>,
105<i>struct libwebsocket *</i> <b>wsi</b>,
106<i>int</i> <b>fd</b>,
Andy Green07034092011-02-13 08:37:12 +0000107<i>char *</i> <b>name</b>,
108<i>int</i> <b>name_len</b>,
109<i>char *</i> <b>rip</b>,
110<i>int</i> <b>rip_len</b>)
111<h3>Arguments</h3>
112<dl>
Andy Greenaaf0b9f2013-01-30 08:12:20 +0800113<dt><b>context</b>
114<dd>Libwebsockets context
115<dt><b>wsi</b>
116<dd>Local struct libwebsocket associated with
Andy Green07034092011-02-13 08:37:12 +0000117<dt><b>fd</b>
118<dd>Connection socket descriptor
119<dt><b>name</b>
120<dd>Buffer to take client address name
121<dt><b>name_len</b>
122<dd>Length of client address name buffer
123<dt><b>rip</b>
124<dd>Buffer to take client address IP qotted quad
125<dt><b>rip_len</b>
126<dd>Length of client address IP buffer
127</dl>
128<h3>Description</h3>
129<blockquote>
130This function fills in <tt><b>name</b></tt> and <tt><b>rip</b></tt> with the name and IP of
131the client connected with socket descriptor <tt><b>fd</b></tt>. Names may be
132truncated if there is not enough room. If either cannot be
133determined, they will be returned as valid zero-length strings.
134</blockquote>
135<hr>
Andy Green9f990342011-02-12 11:57:45 +0000136<h2>libwebsocket_service_fd - Service polled socket with something waiting</h2>
137<i>int</i>
138<b>libwebsocket_service_fd</b>
Peter Hinz56885f32011-03-02 22:03:47 +0000139(<i>struct libwebsocket_context *</i> <b>context</b>,
Andy Green9f990342011-02-12 11:57:45 +0000140<i>struct pollfd *</i> <b>pollfd</b>)
141<h3>Arguments</h3>
142<dl>
Peter Hinz56885f32011-03-02 22:03:47 +0000143<dt><b>context</b>
Andy Green9f990342011-02-12 11:57:45 +0000144<dd>Websocket context
145<dt><b>pollfd</b>
146<dd>The pollfd entry describing the socket fd and which events
147happened.
148</dl>
149<h3>Description</h3>
150<blockquote>
Andy Green75006172013-01-22 12:32:11 +0800151This function takes a pollfd that has POLLIN or POLLOUT activity and
152services it according to the state of the associated struct libwebsocket.
153<p>
154The one call deals with all "service" that might happen on a socket
155including listen accepts, http files as well as websocket protocol.
Andy Green9f990342011-02-12 11:57:45 +0000156</blockquote>
157<hr>
Andy Green6964bb52011-01-23 16:50:33 +0000158<h2>libwebsocket_context_destroy - Destroy the websocket context</h2>
159<i>void</i>
160<b>libwebsocket_context_destroy</b>
Peter Hinz56885f32011-03-02 22:03:47 +0000161(<i>struct libwebsocket_context *</i> <b>context</b>)
Andy Green6964bb52011-01-23 16:50:33 +0000162<h3>Arguments</h3>
163<dl>
Peter Hinz56885f32011-03-02 22:03:47 +0000164<dt><b>context</b>
Andy Green6964bb52011-01-23 16:50:33 +0000165<dd>Websocket context
166</dl>
167<h3>Description</h3>
168<blockquote>
169This function closes any active connections and then frees the
170context. After calling this, any further use of the context is
171undefined.
172</blockquote>
173<hr>
Andy Greend88146d2013-01-22 12:40:35 +0800174<h2>libwebsocket_context_user - get the user data associated with the whole context</h2>
175<i>LWS_EXTERN void *</i>
176<b>libwebsocket_context_user</b>
177(<i>struct libwebsocket_context *</i> <b>context</b>)
178<h3>Arguments</h3>
179<dl>
180<dt><b>context</b>
181<dd>Websocket context
182</dl>
183<h3>Description</h3>
184<blockquote>
185This returns the optional user allocation that can be attached to
186the context the sockets live in at context_create time. It's a way
187to let all sockets serviced in the same context share data without
188using globals statics in the user code.
189</blockquote>
190<hr>
Andy Green6964bb52011-01-23 16:50:33 +0000191<h2>libwebsocket_service - Service any pending websocket activity</h2>
192<i>int</i>
193<b>libwebsocket_service</b>
Peter Hinz56885f32011-03-02 22:03:47 +0000194(<i>struct libwebsocket_context *</i> <b>context</b>,
Andy Green6964bb52011-01-23 16:50:33 +0000195<i>int</i> <b>timeout_ms</b>)
196<h3>Arguments</h3>
197<dl>
Peter Hinz56885f32011-03-02 22:03:47 +0000198<dt><b>context</b>
Andy Green6964bb52011-01-23 16:50:33 +0000199<dd>Websocket context
200<dt><b>timeout_ms</b>
201<dd>Timeout for poll; 0 means return immediately if nothing needed
202service otherwise block and service immediately, returning
203after the timeout if nothing needed service.
204</dl>
205<h3>Description</h3>
206<blockquote>
207This function deals with any pending websocket traffic, for three
208kinds of event. It handles these events on both server and client
209types of connection the same.
210<p>
2111) Accept new connections to our context's server
212<p>
Andy Green6f520a52013-01-29 17:57:39 +08002132) Call the receive callback for incoming frame data received by
Andy Green6964bb52011-01-23 16:50:33 +0000214server or client connections.
215<p>
216You need to call this service function periodically to all the above
217functions to happen; if your application is single-threaded you can
218just call it in your main event loop.
219<p>
220Alternatively you can fork a new process that asynchronously handles
221calling this service in a loop. In that case you are happy if this
222call blocks your thread until it needs to take care of something and
223would call it with a large nonzero timeout. Your loop then takes no
224CPU while there is nothing happening.
225<p>
226If you are calling it in a single-threaded app, you don't want it to
227wait around blocking other things in your loop from happening, so you
228would call it with a timeout_ms of 0, so it returns immediately if
229nothing is pending, or as soon as it services whatever was pending.
230</blockquote>
231<hr>
Andy Green32375b72011-02-19 08:32:53 +0000232<h2>libwebsocket_callback_on_writable - Request a callback when this socket becomes able to be written to without blocking</h2>
Andy Green90c7cbc2011-01-27 06:26:52 +0000233<i>int</i>
234<b>libwebsocket_callback_on_writable</b>
Peter Hinz56885f32011-03-02 22:03:47 +0000235(<i>struct libwebsocket_context *</i> <b>context</b>,
Andy Green62c54d22011-02-14 09:14:25 +0000236<i>struct libwebsocket *</i> <b>wsi</b>)
Andy Green90c7cbc2011-01-27 06:26:52 +0000237<h3>Arguments</h3>
238<dl>
Peter Hinz56885f32011-03-02 22:03:47 +0000239<dt><b>context</b>
Andy Green32375b72011-02-19 08:32:53 +0000240<dd>libwebsockets context
Andy Green90c7cbc2011-01-27 06:26:52 +0000241<dt><b>wsi</b>
242<dd>Websocket connection instance to get callback for
243</dl>
244<hr>
245<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>
246<i>int</i>
247<b>libwebsocket_callback_on_writable_all_protocol</b>
248(<i>const struct libwebsocket_protocols *</i> <b>protocol</b>)
249<h3>Arguments</h3>
250<dl>
251<dt><b>protocol</b>
252<dd>Protocol whose connections will get callbacks
253</dl>
254<hr>
Andy Greenbe93fef2011-02-14 20:25:43 +0000255<h2>libwebsocket_set_timeout - marks the wsi as subject to a timeout</h2>
256<i>void</i>
257<b>libwebsocket_set_timeout</b>
258(<i>struct libwebsocket *</i> <b>wsi</b>,
259<i>enum pending_timeout</i> <b>reason</b>,
260<i>int</i> <b>secs</b>)
261<h3>Arguments</h3>
262<dl>
263<dt><b>wsi</b>
264<dd>Websocket connection instance
265<dt><b>reason</b>
266<dd>timeout reason
267<dt><b>secs</b>
268<dd>how many seconds
269</dl>
270<h3>Description</h3>
271<blockquote>
272<p>
273You will not need this unless you are doing something special
274</blockquote>
275<hr>
Andy Greena6cbece2011-01-27 20:06:03 +0000276<h2>libwebsocket_get_socket_fd - returns the socket file descriptor</h2>
277<i>int</i>
278<b>libwebsocket_get_socket_fd</b>
279(<i>struct libwebsocket *</i> <b>wsi</b>)
280<h3>Arguments</h3>
281<dl>
282<dt><b>wsi</b>
283<dd>Websocket connection instance
284</dl>
285<h3>Description</h3>
286<blockquote>
287<p>
288You will not need this unless you are doing something special
289</blockquote>
290<hr>
Andy Green90c7cbc2011-01-27 06:26:52 +0000291<h2>libwebsocket_rx_flow_control - Enable and disable socket servicing for receieved packets.</h2>
292<i>int</i>
293<b>libwebsocket_rx_flow_control</b>
294(<i>struct libwebsocket *</i> <b>wsi</b>,
295<i>int</i> <b>enable</b>)
296<h3>Arguments</h3>
297<dl>
298<dt><b>wsi</b>
299<dd>Websocket connection instance to get callback for
300<dt><b>enable</b>
301<dd>0 = disable read servicing for this connection, 1 = enable
302</dl>
303<h3>Description</h3>
304<blockquote>
305<p>
306If the output side of a server process becomes choked, this allows flow
307control for the input side.
308</blockquote>
309<hr>
Andy Green2ac5a6f2011-01-28 10:00:18 +0000310<h2>libwebsocket_canonical_hostname - returns this host's hostname</h2>
311<i>const char *</i>
312<b>libwebsocket_canonical_hostname</b>
Peter Hinz56885f32011-03-02 22:03:47 +0000313(<i>struct libwebsocket_context *</i> <b>context</b>)
Andy Green2ac5a6f2011-01-28 10:00:18 +0000314<h3>Arguments</h3>
315<dl>
Peter Hinz56885f32011-03-02 22:03:47 +0000316<dt><b>context</b>
Andy Green2ac5a6f2011-01-28 10:00:18 +0000317<dd>Websocket context
318</dl>
319<h3>Description</h3>
320<blockquote>
321<p>
322This is typically used by client code to fill in the host parameter
323when making a client connection. You can only call it after the context
324has been created.
325</blockquote>
326<hr>
Andy Green4739e5c2011-01-22 12:51:57 +0000327<h2>libwebsocket_create_context - Create the websocket handler</h2>
Andy Greene92cd172011-01-19 13:11:55 +0000328<i>struct libwebsocket_context *</i>
Andy Green4739e5c2011-01-22 12:51:57 +0000329<b>libwebsocket_create_context</b>
Andy Green62a12932010-11-03 11:19:23 +0000330(<i>int</i> <b>port</b>,
Peter Hinz56885f32011-03-02 22:03:47 +0000331<i>const char *</i> <b>interf</b>,
Andy Greenb45993c2010-12-18 15:13:50 +0000332<i>struct libwebsocket_protocols *</i> <b>protocols</b>,
Andy Greend6e09112011-03-05 16:12:15 +0000333<i>struct libwebsocket_extension *</i> <b>extensions</b>,
Andy Green3faa9c72010-11-08 17:03:03 +0000334<i>const char *</i> <b>ssl_cert_filepath</b>,
335<i>const char *</i> <b>ssl_private_key_filepath</b>,
David Galeano2f82be82013-01-09 16:25:54 +0800336<i>const char *</i> <b>ssl_ca_filepath</b>,
Andy Green3faa9c72010-11-08 17:03:03 +0000337<i>int</i> <b>gid</b>,
Andy Green8014b292011-01-30 20:57:25 +0000338<i>int</i> <b>uid</b>,
Alon Levy0291eb32012-10-19 11:21:56 +0200339<i>unsigned int</i> <b>options</b>,
340<i>void *</i> <b>user</b>)
Andy Green62a12932010-11-03 11:19:23 +0000341<h3>Arguments</h3>
342<dl>
343<dt><b>port</b>
Andy Green4739e5c2011-01-22 12:51:57 +0000344<dd>Port to listen on... you can use 0 to suppress listening on
345any port, that's what you want if you are not running a
346websocket server at all but just using it as a client
Peter Hinz56885f32011-03-02 22:03:47 +0000347<dt><b>interf</b>
Andy Green32375b72011-02-19 08:32:53 +0000348<dd>NULL to bind the listen socket to all interfaces, or the
349interface name, eg, "eth2"
Andy Green4f3943a2010-11-12 10:44:16 +0000350<dt><b>protocols</b>
351<dd>Array of structures listing supported protocols and a protocol-
352specific callback for each one. The list is ended with an
353entry that has a NULL callback pointer.
Andy Greenb45993c2010-12-18 15:13:50 +0000354It's not const because we write the owning_server member
Andy Greenc5114822011-03-06 10:29:35 +0000355<dt><b>extensions</b>
356<dd>NULL or array of libwebsocket_extension structs listing the
Andy Green3182ece2013-01-20 17:08:31 +0800357extensions this context supports. If you configured with
358--without-extensions, you should give NULL here.
Andy Green3faa9c72010-11-08 17:03:03 +0000359<dt><b>ssl_cert_filepath</b>
360<dd>If libwebsockets was compiled to use ssl, and you want
361to listen using SSL, set to the filepath to fetch the
362server cert from, otherwise NULL for unencrypted
363<dt><b>ssl_private_key_filepath</b>
364<dd>filepath to private key if wanting SSL mode,
365else ignored
David Galeano2f82be82013-01-09 16:25:54 +0800366<dt><b>ssl_ca_filepath</b>
Andy Green988bd982013-01-10 12:26:13 +0800367<dd>CA certificate filepath or NULL
Andy Green3faa9c72010-11-08 17:03:03 +0000368<dt><b>gid</b>
369<dd>group id to change to after setting listen socket, or -1.
370<dt><b>uid</b>
371<dd>user id to change to after setting listen socket, or -1.
Andy Greenbfb051f2011-02-09 08:49:14 +0000372<dt><b>options</b>
373<dd>0, or LWS_SERVER_OPTION_DEFEAT_CLIENT_MASK
Andy Green788c4a82012-10-22 12:29:57 +0100374<dt><b>user</b>
375<dd>optional user pointer that can be recovered via the context
376pointer using libwebsocket_context_user
Andy Green62a12932010-11-03 11:19:23 +0000377</dl>
378<h3>Description</h3>
379<blockquote>
Andy Green47943ae2010-11-12 11:15:49 +0000380This function creates the listening socket and takes care
Andy Green62a12932010-11-03 11:19:23 +0000381of all initialization in one step.
382<p>
Andy Greene92cd172011-01-19 13:11:55 +0000383After initialization, it returns a struct libwebsocket_context * that
384represents this server. After calling, user code needs to take care
385of calling <b>libwebsocket_service</b> with the context pointer to get the
386server's sockets serviced. This can be done in the same process context
387or a forked process, or another thread,
Andy Green47943ae2010-11-12 11:15:49 +0000388<p>
389The protocol callback functions are called for a handful of events
390including http requests coming in, websocket connections becoming
Andy Green62a12932010-11-03 11:19:23 +0000391established, and data arriving; it's also called periodically to allow
392async transmission.
393<p>
Andy Green47943ae2010-11-12 11:15:49 +0000394HTTP requests are sent always to the FIRST protocol in <tt><b>protocol</b></tt>, since
395at that time websocket protocol has not been negotiated. Other
396protocols after the first one never see any HTTP callack activity.
397<p>
Andy Green62a12932010-11-03 11:19:23 +0000398The server created is a simple http server by default; part of the
399websocket standard is upgrading this http connection to a websocket one.
400<p>
401This allows the same server to provide files like scripts and favicon /
402images or whatever over http and dynamic data over websockets all in
403one place; they're all handled in the user callback.
404</blockquote>
405<hr>
Andy Greenb45993c2010-12-18 15:13:50 +0000406<h2>libwebsockets_get_protocol - Returns a protocol pointer from a websocket connection.</h2>
407<i>const struct libwebsocket_protocols *</i>
408<b>libwebsockets_get_protocol</b>
409(<i>struct libwebsocket *</i> <b>wsi</b>)
410<h3>Arguments</h3>
411<dl>
412<dt><b>wsi</b>
413<dd>pointer to struct websocket you want to know the protocol of
414</dl>
415<h3>Description</h3>
416<blockquote>
417<p>
Andy Green6f520a52013-01-29 17:57:39 +0800418Some apis can act on all live connections of a given protocol,
419this is how you can get a pointer to the active protocol if needed.
Andy Greenacbaee62013-01-18 22:00:22 +0800420</blockquote>
421<hr>
Andy Green43db0452013-01-10 19:50:35 +0800422<h2>lws_set_log_level - Set the logging bitfield</h2>
423<i>void</i>
424<b>lws_set_log_level</b>
Andy Greende8f27a2013-01-12 09:17:42 +0800425(<i>int</i> <b>level</b>,
Andy Green058ba812013-01-19 11:32:18 +0800426<i>void (*</i><b>log_emit_function</b>) <i>(int level, const char *line)</i>)
Andy Green43db0452013-01-10 19:50:35 +0800427<h3>Arguments</h3>
428<dl>
429<dt><b>level</b>
430<dd>OR together the LLL_ debug contexts you want output from
Andy Greende8f27a2013-01-12 09:17:42 +0800431<dt><b>log_emit_function</b>
432<dd>NULL to leave it as it is, or a user-supplied
433function to perform log string emission instead of
434the default stderr one.
Andy Green43db0452013-01-10 19:50:35 +0800435</dl>
436<h3>Description</h3>
437<blockquote>
Andy Greende8f27a2013-01-12 09:17:42 +0800438log level defaults to "err" and "warn" contexts enabled only and
439emission on stderr.
Andy Green43db0452013-01-10 19:50:35 +0800440</blockquote>
441<hr>
Andy Greend88146d2013-01-22 12:40:35 +0800442<h2>libwebsocket_write - Apply protocol then write data to client</h2>
443<i>int</i>
444<b>libwebsocket_write</b>
445(<i>struct libwebsocket *</i> <b>wsi</b>,
446<i>unsigned char *</i> <b>buf</b>,
447<i>size_t</i> <b>len</b>,
448<i>enum libwebsocket_write_protocol</i> <b>protocol</b>)
449<h3>Arguments</h3>
450<dl>
451<dt><b>wsi</b>
452<dd>Websocket instance (available from user callback)
453<dt><b>buf</b>
454<dd>The data to send. For data being sent on a websocket
455connection (ie, not default http), this buffer MUST have
456LWS_SEND_BUFFER_PRE_PADDING bytes valid BEFORE the pointer
457and an additional LWS_SEND_BUFFER_POST_PADDING bytes valid
458in the buffer after (buf + len). This is so the protocol
459header and trailer data can be added in-situ.
460<dt><b>len</b>
461<dd>Count of the data bytes in the payload starting from buf
462<dt><b>protocol</b>
463<dd>Use LWS_WRITE_HTTP to reply to an http connection, and one
464of LWS_WRITE_BINARY or LWS_WRITE_TEXT to send appropriate
465data on a websockets connection. Remember to allow the extra
466bytes before and after buf if LWS_WRITE_BINARY or LWS_WRITE_TEXT
467are used.
468</dl>
469<h3>Description</h3>
470<blockquote>
471This function provides the way to issue data back to the client
472for both http and websocket protocols.
473<p>
474In the case of sending using websocket protocol, be sure to allocate
475valid storage before and after buf as explained above. This scheme
476allows maximum efficiency of sending data and protocol in a single
477packet while not burdening the user code with any protocol knowledge.
478</blockquote>
479<hr>
480<h2>libwebsockets_serve_http_file - Send a file back to the client using http</h2>
481<i>int</i>
482<b>libwebsockets_serve_http_file</b>
483(<i>struct libwebsocket_context *</i> <b>context</b>,
484<i>struct libwebsocket *</i> <b>wsi</b>,
485<i>const char *</i> <b>file</b>,
486<i>const char *</i> <b>content_type</b>)
487<h3>Arguments</h3>
488<dl>
489<dt><b>context</b>
490<dd>libwebsockets context
491<dt><b>wsi</b>
492<dd>Websocket instance (available from user callback)
493<dt><b>file</b>
494<dd>The file to issue over http
495<dt><b>content_type</b>
496<dd>The http content type, eg, text/html
497</dl>
498<h3>Description</h3>
499<blockquote>
500This function is intended to be called from the callback in response
501to http requests from the client. It allows the callback to issue
502local files down the http link in a single step.
503</blockquote>
504<hr>
Andy Green2fd3f2f2013-01-18 09:49:20 +0800505<h2>lws_frame_is_binary - </h2>
506<i>int</i>
507<b>lws_frame_is_binary</b>
508(<i>struct libwebsocket *</i> <b>wsi</b>)
509<h3>Arguments</h3>
510<dl>
511<dt><b>wsi</b>
512<dd>the connection we are inquiring about
513</dl>
514<h3>Description</h3>
515<blockquote>
516This is intended to be called from the LWS_CALLBACK_RECEIVE callback if
517it's interested to see if the frame it's dealing with was sent in binary
518mode.
519</blockquote>
520<hr>
Andy Green38e57bb2011-01-19 12:20:27 +0000521<h2>libwebsockets_remaining_packet_payload - Bytes to come before "overall" rx packet is complete</h2>
522<i>size_t</i>
523<b>libwebsockets_remaining_packet_payload</b>
524(<i>struct libwebsocket *</i> <b>wsi</b>)
525<h3>Arguments</h3>
526<dl>
527<dt><b>wsi</b>
528<dd>Websocket instance (available from user callback)
529</dl>
530<h3>Description</h3>
531<blockquote>
532This function is intended to be called from the callback if the
533user code is interested in "complete packets" from the client.
534libwebsockets just passes through payload as it comes and issues a buffer
535additionally when it hits a built-in limit. The LWS_CALLBACK_RECEIVE
536callback handler can use this API to find out if the buffer it has just
537been given is the last piece of a "complete packet" from the client --
538when that is the case <b>libwebsockets_remaining_packet_payload</b> will return
5390.
540<p>
541Many protocols won't care becuse their packets are always small.
542</blockquote>
543<hr>
Andy Green8f037e42010-12-19 22:13:26 +0000544<h2>callback - User server actions</h2>
Andy Green07b56e62011-10-03 19:30:22 +0800545<i>LWS_EXTERN int</i>
Andy Green8f037e42010-12-19 22:13:26 +0000546<b>callback</b>
Darin Willitsc19456f2011-02-14 17:52:39 +0000547(<i>struct libwebsocket_context *</i> <b>context</b>,
Andy Green62c54d22011-02-14 09:14:25 +0000548<i>struct libwebsocket *</i> <b>wsi</b>,
Andy Green8f037e42010-12-19 22:13:26 +0000549<i>enum libwebsocket_callback_reasons</i> <b>reason</b>,
550<i>void *</i> <b>user</b>,
551<i>void *</i> <b>in</b>,
552<i>size_t</i> <b>len</b>)
553<h3>Arguments</h3>
554<dl>
Andy Green32375b72011-02-19 08:32:53 +0000555<dt><b>context</b>
556<dd>Websockets context
Andy Green8f037e42010-12-19 22:13:26 +0000557<dt><b>wsi</b>
558<dd>Opaque websocket instance pointer
559<dt><b>reason</b>
560<dd>The reason for the call
561<dt><b>user</b>
562<dd>Pointer to per-session user data allocated by library
563<dt><b>in</b>
564<dd>Pointer used for some callback reasons
565<dt><b>len</b>
566<dd>Length set for some callback reasons
567</dl>
568<h3>Description</h3>
569<blockquote>
570This callback is the way the user controls what is served. All the
571protocol detail is hidden and handled by the library.
572<p>
573For each connection / session there is user data allocated that is
574pointed to by "user". You set the size of this user data area when
575the library is initialized with libwebsocket_create_server.
576<p>
577You get an opportunity to initialize user data when called back with
578LWS_CALLBACK_ESTABLISHED reason.
579</blockquote>
580<h3>LWS_CALLBACK_ESTABLISHED</h3>
581<blockquote>
Andy Green90c7cbc2011-01-27 06:26:52 +0000582after the server completes a handshake with
583an incoming client
584</blockquote>
David Brooks2c60d952012-04-20 12:19:01 +0800585<h3>LWS_CALLBACK_CLIENT_CONNECTION_ERROR</h3>
586<blockquote>
587the request client connection has
588been unable to complete a handshake with the remote server
589</blockquote>
Andy Green90c7cbc2011-01-27 06:26:52 +0000590<h3>LWS_CALLBACK_CLIENT_ESTABLISHED</h3>
591<blockquote>
592after your client connection completed
593a handshake with the remote server
Andy Green8f037e42010-12-19 22:13:26 +0000594</blockquote>
595<h3>LWS_CALLBACK_CLOSED</h3>
596<blockquote>
597when the websocket session ends
598</blockquote>
599<h3>LWS_CALLBACK_BROADCAST</h3>
600<blockquote>
601signal to send to client (you would use
602<b>libwebsocket_write</b> taking care about the
603special buffer requirements
604</blockquote>
605<h3>LWS_CALLBACK_RECEIVE</h3>
606<blockquote>
Andy Green90c7cbc2011-01-27 06:26:52 +0000607data has appeared for this server endpoint from a
608remote client, it can be found at *in and is
609len bytes long
610</blockquote>
Andy Greena6cbece2011-01-27 20:06:03 +0000611<h3>LWS_CALLBACK_CLIENT_RECEIVE_PONG</h3>
612<blockquote>
613if you elected to see PONG packets,
614they appear with this callback reason. PONG
615packets only exist in 04+ protocol
616</blockquote>
Andy Green90c7cbc2011-01-27 06:26:52 +0000617<h3>LWS_CALLBACK_CLIENT_RECEIVE</h3>
618<blockquote>
619data has appeared from the server for the
620client connection, it can be found at *in and
621is len bytes long
Andy Green8f037e42010-12-19 22:13:26 +0000622</blockquote>
623<h3>LWS_CALLBACK_HTTP</h3>
624<blockquote>
625an http request has come from a client that is not
626asking to upgrade the connection to a websocket
627one. This is a chance to serve http content,
628for example, to send a script to the client
629which will then open the websockets connection.
Andy Green7619c472011-01-23 17:47:08 +0000630<tt><b>in</b></tt> points to the URI path requested and
Andy Green8f037e42010-12-19 22:13:26 +0000631<b>libwebsockets_serve_http_file</b> makes it very
632simple to send back a file to the client.
Andy Green24b588b2013-01-13 09:53:18 +0800633Normally after sending the file you are done
634with the http connection, since the rest of the
635activity will come by websockets from the script
636that was delivered by http, so you will want to
637return 1; to close and free up the connection.
638That's important because it uses a slot in the
639total number of client connections allowed set
640by MAX_CLIENTS.
Andy Green8f037e42010-12-19 22:13:26 +0000641</blockquote>
Andy Greend280b6e2013-01-15 13:40:23 +0800642<h3>LWS_CALLBACK_HTTP_FILE_COMPLETION</h3>
643<blockquote>
644a file requested to be send down
645http link has completed.
646</blockquote>
Andy Greene9739ed2011-03-07 21:40:59 +0000647<h3>LWS_CALLBACK_SERVER_WRITEABLE</h3>
Andy Green90c7cbc2011-01-27 06:26:52 +0000648<blockquote>
Andy Greene9739ed2011-03-07 21:40:59 +0000649If you call
Andy Green90c7cbc2011-01-27 06:26:52 +0000650<b>libwebsocket_callback_on_writable</b> on a connection, you will
Andy Greene9739ed2011-03-07 21:40:59 +0000651get one of these callbacks coming when the connection socket
652is able to accept another write packet without blocking.
653If it already was able to take another packet without blocking,
654you'll get this callback at the next call to the service loop
655function. Notice that CLIENTs get LWS_CALLBACK_CLIENT_WRITEABLE
656and servers get LWS_CALLBACK_SERVER_WRITEABLE.
Andy Green90c7cbc2011-01-27 06:26:52 +0000657</blockquote>
Andy Green07034092011-02-13 08:37:12 +0000658<h3>LWS_CALLBACK_FILTER_NETWORK_CONNECTION</h3>
659<blockquote>
660called when a client connects to
661the server at network level; the connection is accepted but then
662passed to this callback to decide whether to hang up immediately
663or not, based on the client IP. <tt><b>user</b></tt> contains the connection
664socket's descriptor. Return non-zero to terminate
665the connection before sending or receiving anything.
666Because this happens immediately after the network connection
667from the client, there's no websocket protocol selected yet so
668this callback is issued only to protocol 0.
669</blockquote>
Andy Greenc85619d2011-02-13 08:25:26 +0000670<h3>LWS_CALLBACK_FILTER_PROTOCOL_CONNECTION</h3>
671<blockquote>
672called when the handshake has
673been received and parsed from the client, but the response is
674not sent yet. Return non-zero to disallow the connection.
Andy Green07034092011-02-13 08:37:12 +0000675<tt><b>user</b></tt> is a pointer to an array of struct lws_tokens, you can
676use the header enums lws_token_indexes from libwebsockets.h
677to check for and read the supported header presence and
678content before deciding to allow the handshake to proceed or
679to kill the connection.
Andy Green0894bda2011-02-19 09:09:11 +0000680</blockquote>
681<h3>LWS_CALLBACK_OPENSSL_LOAD_EXTRA_CLIENT_VERIFY_CERTS</h3>
682<blockquote>
Andy Green6901cb32011-02-21 08:06:47 +0000683if configured for
Andy Green0894bda2011-02-19 09:09:11 +0000684including OpenSSL support, this callback allows your user code
685to perform extra <b>SSL_CTX_load_verify_locations</b> or similar
686calls to direct OpenSSL where to find certificates the client
687can use to confirm the remote server identity. <tt><b>user</b></tt> is the
688OpenSSL SSL_CTX*
Andy Green6901cb32011-02-21 08:06:47 +0000689</blockquote>
690<h3>LWS_CALLBACK_OPENSSL_LOAD_EXTRA_SERVER_VERIFY_CERTS</h3>
691<blockquote>
692if configured for
693including OpenSSL support, this callback allows your user code
694to load extra certifcates into the server which allow it to
695verify the validity of certificates returned by clients. <tt><b>user</b></tt>
696is the server's OpenSSL SSL_CTX*
697</blockquote>
698<h3>LWS_CALLBACK_OPENSSL_PERFORM_CLIENT_CERT_VERIFICATION</h3>
699<blockquote>
700if the
701libwebsockets context was created with the option
702LWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT, then this
703callback is generated during OpenSSL verification of the cert
704sent from the client. It is sent to protocol[0] callback as
705no protocol has been negotiated on the connection yet.
706Notice that the libwebsockets context and wsi are both NULL
707during this callback. See
708</blockquote>
709<h3>http</h3>
710<blockquote>
711//www.openssl.org/docs/ssl/SSL_CTX_set_verify.html
712to understand more detail about the OpenSSL callback that
713generates this libwebsockets callback and the meanings of the
714arguments passed. In this callback, <tt><b>user</b></tt> is the x509_ctx,
715<tt><b>in</b></tt> is the ssl pointer and <tt><b>len</b></tt> is preverify_ok
716Notice that this callback maintains libwebsocket return
717conventions, return 0 to mean the cert is OK or 1 to fail it.
718This also means that if you don't handle this callback then
719the default callback action of returning 0 allows the client
720certificates.
Andy Green385e7ad2011-03-01 21:06:02 +0000721</blockquote>
722<h3>LWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER</h3>
723<blockquote>
724this callback happens
725when a client handshake is being compiled. <tt><b>user</b></tt> is NULL,
726<tt><b>in</b></tt> is a char **, it's pointing to a char * which holds the
727next location in the header buffer where you can add
728headers, and <tt><b>len</b></tt> is the remaining space in the header buffer,
729which is typically some hundreds of bytes. So, to add a canned
730cookie, your handler code might look similar to:
731<p>
732char **p = (char **)in;
733<p>
734if (len &lt; 100)
735return 1;
736<p>
737*p += sprintf(*p, "Cookie: a=b\x0d\x0a");
738<p>
739return 0;
740<p>
741Notice if you add anything, you just have to take care about
742the CRLF on the line you added. Obviously this callback is
743optional, if you don't handle it everything is fine.
744<p>
745Notice the callback is coming to protocols[0] all the time,
746because there is no specific protocol handshook yet.
Andy Greenc5114822011-03-06 10:29:35 +0000747</blockquote>
748<h3>LWS_CALLBACK_CONFIRM_EXTENSION_OKAY</h3>
749<blockquote>
750When the server handshake code
751sees that it does support a requested extension, before
752accepting the extension by additing to the list sent back to
753the client it gives this callback just to check that it's okay
754to use that extension. It calls back to the requested protocol
755and with <tt><b>in</b></tt> being the extension name, <tt><b>len</b></tt> is 0 and <tt><b>user</b></tt> is
756valid. Note though at this time the ESTABLISHED callback hasn't
757happened yet so if you initialize <tt><b>user</b></tt> content there, <tt><b>user</b></tt>
758content during this callback might not be useful for anything.
759Notice this callback comes to protocols[0].
Andy Greenc6517fa2011-03-06 13:15:29 +0000760</blockquote>
761<h3>LWS_CALLBACK_CLIENT_CONFIRM_EXTENSION_SUPPORTED</h3>
762<blockquote>
763When a client
764connection is being prepared to start a handshake to a server,
765each supported extension is checked with protocols[0] callback
766with this reason, giving the user code a chance to suppress the
767claim to support that extension by returning non-zero. If
768unhandled, by default 0 will be returned and the extension
769support included in the header to the server. Notice this
770callback comes to protocols[0].
Andy Greenc85619d2011-02-13 08:25:26 +0000771<p>
772The next four reasons are optional and only need taking care of if you
773will be integrating libwebsockets sockets into an external polling
774array.
775</blockquote>
776<h3>LWS_CALLBACK_ADD_POLL_FD</h3>
777<blockquote>
778libwebsocket deals with its <b>poll</b> loop
779internally, but in the case you are integrating with another
780server you will need to have libwebsocket sockets share a
781polling array with the other server. This and the other
782POLL_FD related callbacks let you put your specialized
783poll array interface code in the callback for protocol 0, the
784first protocol you support, usually the HTTP protocol in the
785serving case. This callback happens when a socket needs to be
786</blockquote>
787<h3>added to the polling loop</h3>
788<blockquote>
789<tt><b>user</b></tt> contains the fd, and
790<tt><b>len</b></tt> is the events bitmap (like, POLLIN). If you are using the
791internal polling loop (the "service" callback), you can just
792ignore these callbacks.
793</blockquote>
794<h3>LWS_CALLBACK_DEL_POLL_FD</h3>
795<blockquote>
796This callback happens when a socket descriptor
797needs to be removed from an external polling array. <tt><b>user</b></tt> is
798the socket desricptor. If you are using the internal polling
799loop, you can just ignore it.
800</blockquote>
801<h3>LWS_CALLBACK_SET_MODE_POLL_FD</h3>
802<blockquote>
803This callback happens when libwebsockets
804wants to modify the events for the socket descriptor in <tt><b>user</b></tt>.
805The handler should OR <tt><b>len</b></tt> on to the events member of the pollfd
806struct for this socket descriptor. If you are using the
807internal polling loop, you can just ignore it.
808</blockquote>
809<h3>LWS_CALLBACK_CLEAR_MODE_POLL_FD</h3>
810<blockquote>
811This callback occurs when libwebsockets
812wants to modify the events for the socket descriptor in <tt><b>user</b></tt>.
813The handler should AND ~<tt><b>len</b></tt> on to the events member of the
814pollfd struct for this socket descriptor. If you are using the
815internal polling loop, you can just ignore it.
816</blockquote>
Andy Green8f037e42010-12-19 22:13:26 +0000817<hr>
Andy Green57b4e9a2011-03-06 13:14:46 +0000818<h2>extension_callback - Hooks to allow extensions to operate</h2>
Andy Green07b56e62011-10-03 19:30:22 +0800819<i>LWS_EXTERN int</i>
Andy Green57b4e9a2011-03-06 13:14:46 +0000820<b>extension_callback</b>
821(<i>struct libwebsocket_context *</i> <b>context</b>,
Andy Green46c2ea02011-03-22 09:04:01 +0000822<i>struct libwebsocket_extension *</i> <b>ext</b>,
Andy Green57b4e9a2011-03-06 13:14:46 +0000823<i>struct libwebsocket *</i> <b>wsi</b>,
David Brooks2c60d952012-04-20 12:19:01 +0800824<i>enum libwebsocket_extension_callback_reasons</i> <b>reason</b>,
Andy Green57b4e9a2011-03-06 13:14:46 +0000825<i>void *</i> <b>user</b>,
826<i>void *</i> <b>in</b>,
827<i>size_t</i> <b>len</b>)
828<h3>Arguments</h3>
829<dl>
830<dt><b>context</b>
831<dd>Websockets context
Andy Green46c2ea02011-03-22 09:04:01 +0000832<dt><b>ext</b>
833<dd>This extension
Andy Green57b4e9a2011-03-06 13:14:46 +0000834<dt><b>wsi</b>
835<dd>Opaque websocket instance pointer
836<dt><b>reason</b>
837<dd>The reason for the call
838<dt><b>user</b>
839<dd>Pointer to per-session user data allocated by library
840<dt><b>in</b>
841<dd>Pointer used for some callback reasons
842<dt><b>len</b>
843<dd>Length set for some callback reasons
844</dl>
845<h3>Description</h3>
846<blockquote>
847Each extension that is active on a particular connection receives
848callbacks during the connection lifetime to allow the extension to
849operate on websocket data and manage itself.
850<p>
851Libwebsockets takes care of allocating and freeing "user" memory for
852each active extension on each connection. That is what is pointed to
853by the <tt><b>user</b></tt> parameter.
854</blockquote>
855<h3>LWS_EXT_CALLBACK_CONSTRUCT</h3>
856<blockquote>
857called when the server has decided to
858select this extension from the list provided by the client,
859just before the server will send back the handshake accepting
860the connection with this extension active. This gives the
861extension a chance to initialize its connection context found
862in <tt><b>user</b></tt>.
863</blockquote>
Andy Green2366b1c2011-03-06 13:15:31 +0000864<h3>LWS_EXT_CALLBACK_CLIENT_CONSTRUCT</h3>
865<blockquote>
866same as LWS_EXT_CALLBACK_CONSTRUCT
867but called when client is instantiating this extension. Some
868extensions will work the same on client and server side and then
869you can just merge handlers for both CONSTRUCTS.
870</blockquote>
Andy Green57b4e9a2011-03-06 13:14:46 +0000871<h3>LWS_EXT_CALLBACK_DESTROY</h3>
872<blockquote>
873called when the connection the extension was
874being used on is about to be closed and deallocated. It's the
875last chance for the extension to deallocate anything it has
876allocated in the user data (pointed to by <tt><b>user</b></tt>) before the
Andy Green2366b1c2011-03-06 13:15:31 +0000877user data is deleted. This same callback is used whether you
878are in client or server instantiation context.
Andy Green57b4e9a2011-03-06 13:14:46 +0000879</blockquote>
880<h3>LWS_EXT_CALLBACK_PACKET_RX_PREPARSE</h3>
881<blockquote>
882when this extension was active on
883a connection, and a packet of data arrived at the connection,
884it is passed to this callback to give the extension a chance to
885change the data, eg, decompress it. <tt><b>user</b></tt> is pointing to the
886extension's private connection context data, <tt><b>in</b></tt> is pointing
887to an lws_tokens struct, it consists of a char * pointer called
888token, and an int called token_len. At entry, these are
889set to point to the received buffer and set to the content
890length. If the extension will grow the content, it should use
891a new buffer allocated in its private user context data and
892set the pointed-to lws_tokens members to point to its buffer.
893</blockquote>
894<h3>LWS_EXT_CALLBACK_PACKET_TX_PRESEND</h3>
895<blockquote>
896this works the same way as
897LWS_EXT_CALLBACK_PACKET_RX_PREPARSE above, except it gives the
898extension a chance to change websocket data just before it will
899be sent out. Using the same lws_token pointer scheme in <tt><b>in</b></tt>,
900the extension can change the buffer and the length to be
901transmitted how it likes. Again if it wants to grow the
902buffer safely, it should copy the data into its own buffer and
903set the lws_tokens token pointer to it.
904</blockquote>
905<hr>
Andy Green4f3943a2010-11-12 10:44:16 +0000906<h2>struct libwebsocket_protocols - List of protocols and handlers server supports.</h2>
907<b>struct libwebsocket_protocols</b> {<br>
908&nbsp; &nbsp; <i>const char *</i> <b>name</b>;<br>
David Brooks2c60d952012-04-20 12:19:01 +0800909&nbsp; &nbsp; <i>callback_function *</i> <b>callback</b>;<br>
Andy Green4f3943a2010-11-12 10:44:16 +0000910&nbsp; &nbsp; <i>size_t</i> <b>per_session_data_size</b>;<br>
Andy Greenb45993c2010-12-18 15:13:50 +0000911&nbsp; &nbsp; <i>struct libwebsocket_context *</i> <b>owning_server</b>;<br>
912&nbsp; &nbsp; <i>int</i> <b>broadcast_socket_port</b>;<br>
913&nbsp; &nbsp; <i>int</i> <b>broadcast_socket_user_fd</b>;<br>
914&nbsp; &nbsp; <i>int</i> <b>protocol_index</b>;<br>
Andy Green4f3943a2010-11-12 10:44:16 +0000915};<br>
916<h3>Members</h3>
917<dl>
918<dt><b>name</b>
919<dd>Protocol name that must match the one given in the client
920Javascript new WebSocket(url, 'protocol') name
921<dt><b>callback</b>
922<dd>The service callback used for this protocol. It allows the
923service action for an entire protocol to be encapsulated in
924the protocol-specific callback
925<dt><b>per_session_data_size</b>
926<dd>Each new connection using this protocol gets
927this much memory allocated on connection establishment and
928freed on connection takedown. A pointer to this per-connection
929allocation is passed into the callback in the 'user' parameter
Andy Greenb45993c2010-12-18 15:13:50 +0000930<dt><b>owning_server</b>
931<dd>the server init call fills in this opaque pointer when
932registering this protocol with the server.
933<dt><b>broadcast_socket_port</b>
934<dd>the server init call fills this in with the
935localhost port number used to forward broadcasts for this
936protocol
937<dt><b>broadcast_socket_user_fd</b>
938<dd>the server init call fills this in ... the <b>main</b>
939process context can write to this socket to perform broadcasts
940(use the <b>libwebsockets_broadcast</b> api to do this instead,
941it works from any process context)
942<dt><b>protocol_index</b>
943<dd>which protocol we are starting from zero
Andy Green4f3943a2010-11-12 10:44:16 +0000944</dl>
945<h3>Description</h3>
946<blockquote>
947This structure represents one protocol supported by the server. An
948array of these structures is passed to <b>libwebsocket_create_server</b>
949allows as many protocols as you like to be handled by one server.
950</blockquote>
951<hr>
Andy Greend6e09112011-03-05 16:12:15 +0000952<h2>struct libwebsocket_extension - An extension we know how to cope with</h2>
953<b>struct libwebsocket_extension</b> {<br>
954&nbsp; &nbsp; <i>const char *</i> <b>name</b>;<br>
David Brooks2c60d952012-04-20 12:19:01 +0800955&nbsp; &nbsp; <i>extension_callback_function *</i> <b>callback</b>;<br>
Andy Greend6e09112011-03-05 16:12:15 +0000956&nbsp; &nbsp; <i>size_t</i> <b>per_session_data_size</b>;<br>
Andy Greenaa6fc442012-04-12 13:26:49 +0800957&nbsp; &nbsp; <i>void *</i> <b>per_context_private_data</b>;<br>
Andy Greend6e09112011-03-05 16:12:15 +0000958};<br>
959<h3>Members</h3>
960<dl>
961<dt><b>name</b>
962<dd>Formal extension name, eg, "deflate-stream"
963<dt><b>callback</b>
964<dd>Service callback
965<dt><b>per_session_data_size</b>
966<dd>Libwebsockets will auto-malloc this much
967memory for the use of the extension, a pointer
968to it comes in the <tt><b>user</b></tt> callback parameter
Andy Greenaa6fc442012-04-12 13:26:49 +0800969<dt><b>per_context_private_data</b>
970<dd>Optional storage for this externsion that
971is per-context, so it can track stuff across
972all sessions, etc, if it wants
Andy Greend6e09112011-03-05 16:12:15 +0000973</dl>
974<hr>