Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 61 lines (53 sloc) 1.922 kb
463e81b Zhihui Jiao update websocket: both as server type and session type
onlychoice authored
1 %%% This code was developped by IDEALX (http://IDEALX.org/) and
2 %%% contributors (their names can be found in the CONTRIBUTORS file).
3 %%% Copyright (C) 2000-2001 IDEALX
4 %%%
5 %%% This program is free software; you can redistribute it and/or modify
6 %%% it under the terms of the GNU General Public License as published by
7 %%% the Free Software Foundation; either version 2 of the License, or
8 %%% (at your option) any later version.
9 %%%
10 %%% This program is distributed in the hope that it will be useful,
11 %%% but WITHOUT ANY WARRANTY; without even the implied warranty of
12 %%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 %%% GNU General Public License for more details.
14 %%%
15 %%% You should have received a copy of the GNU General Public License
16 %%% along with this program; if not, write to the Free Software
17 %%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
18 %%%
19 %%% In addition, as a special exception, you have the permission to
20 %%% link the code of this program with any library released under
21 %%% the EPL license and distribute linked combinations including
22 %%% the two.
23
24
25 -vc('$Id$ ').
26 -author('jzhihui521@gmail.com').
27
28 %% use by the client to create the request
29 -record(websocket_request, {
30 version = "13", % default is 13(rfc6455)
31 type, % connect or message
32 path, % connection path
33 subprotos = [], % subprotocols
34 data % websocket data
35 }).
36
37 -record(websocket_dyndata, {
38 none
39 }
40 ).
41
42 -record(websocket_session, {
43 status, % status of handshake
44 accept % Sec-Websocket-Accept header value
45 }).
46
47 -record(http, {
48 status,
49 accept,
50 headers=[],
51 close
52 }).
53
54 %% opcode of websocket
55 -define(OP_CONT, 0).
56 -define(OP_TEXT, 1).
57 -define(OP_BIN, 2).
58 -define(OP_CLOSE, 8).
59 -define(OP_PING, 9).
60 -define(OP_PONG, 10).
Something went wrong with that request. Please try again.