Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 55 lines (49 sloc) 1.898 kb
aaf8bfb Zhihui Jiao update copyright header for websocket and amqp related files
onlychoice authored
1 %%% This code was developped by Zhihui Jiao(jzhihui521@gmail.com).
2 %%%
3 %%% Copyright (C) 2013 Zhihui Jiao
463e81b Zhihui Jiao update websocket: both as server type and session type
onlychoice authored
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
b33fa9f Nicolas Niclausse add precision about license exception (EPL/MPL)
nniclausse authored
22 %%% the two; the MPL (Mozilla Public License), which EPL (Erlang
23 %%% Public License) is based on, is included in this exception.
463e81b Zhihui Jiao update websocket: both as server type and session type
onlychoice authored
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
f40efc5 Zhihui Jiao add text frame support for Websocket, and update doc
onlychoice authored
33 frame = "binary",
463e81b Zhihui Jiao update websocket: both as server type and session type
onlychoice authored
34 subprotos = [], % subprotocols
35 data % websocket data
36 }).
37
38 -record(websocket_dyndata, {
39 none
40 }
41 ).
42
43 -record(websocket_session, {
44 status, % status of handshake
45 accept % Sec-Websocket-Accept header value
46 }).
47
48 %% opcode of websocket
49 -define(OP_CONT, 0).
50 -define(OP_TEXT, 1).
51 -define(OP_BIN, 2).
52 -define(OP_CLOSE, 8).
53 -define(OP_PING, 9).
54 -define(OP_PONG, 10).
Something went wrong with that request. Please try again.