Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 146 lines (126 sloc) 5.24 kB
21abc5b @klacke Initial revision
authored
1 %%%----------------------------------------------------------------------
2 %%% File : yaws_api.hrl
3 %%% Author : Claes Wikstrom <klacke@hyber.org>
455578a @vinoski major trailing whitespace cleanup
vinoski authored
4 %%% Purpose :
21abc5b @klacke Initial revision
authored
5 %%% Created : 24 Jan 2002 by Claes Wikstrom <klacke@hyber.org>
6 %%%----------------------------------------------------------------------
7
8 -author('klacke@hyber.org').
9
10 -record(arg, {
88996d8 @vinoski cosmetic comment and whitespace cleanup in yaws_api.hrl
vinoski authored
11 clisock, % the socket leading to the peer client
12 client_ip_port, % {ClientIp, ClientPort} tuple
13 headers, % headers
14 req, % request
15 clidata, % The client data (as a binary in POST requests)
16 server_path, % The normalized server path
17 % (pre-querystring part of URI)
18 querydata, % For URIs of the form ...?querydata
19 % equiv of cgi QUERY_STRING
20 appmoddata, % (deprecated - use pathinfo instead) the remainder
21 % of the path leading up to the query
22 docroot, % Physical base location of data for this request
23 docroot_mount, % virtual directory e.g /myapp/ that the docroot
24 % refers to.
25 fullpath, % full deep path to yaws file
26 cont, % Continuation for chunked multipart uploads
27 state, % State for use by users of the out/1 callback
28 pid, % pid of the yaws worker process
29 opaque, % useful to pass static data
30 appmod_prepath, % (deprecated - use prepath instead) path in front
31 % of: <appmod><appmoddata>
32 prepath, % Path prior to 'dynamic' segment of URI.
33 % ie http://some.host/<prepath>/<script-point>/d/e
34 % where <script-point> is an appmod mount point,
35 % or .yaws,.php,.cgi,.fcgi etc script file.
36 pathinfo % Set to '/d/e' when calling c.yaws for the request
37 % http://some.host/a/b/c.yaws/d/e
38 % equiv of cgi PATH_INFO
d0caaf6 @klacke tabs cleanup
authored
39 }).
21abc5b @klacke Initial revision
authored
40
41
42 -record(http_request, {method,
d0caaf6 @klacke tabs cleanup
authored
43 path,
44 version}).
21abc5b @klacke Initial revision
authored
45
8e69e2c @klacke first almost working vsn of revproxy
authored
46 -record(http_response, {version,
d0caaf6 @klacke tabs cleanup
authored
47 status,
48 phrase}).
8e69e2c @klacke first almost working vsn of revproxy
authored
49
f983a1b @capflam arg_rewrite mods can now return HTTP responses (capflam)
capflam authored
50 -record(rewrite_response, {status,
51 headers = [],
52 content = <<>>}).
53
21abc5b @klacke Initial revision
authored
54 -record(headers, {
d0caaf6 @klacke tabs cleanup
authored
55 connection,
56 accept,
57 host,
58 if_modified_since,
59 if_match,
60 if_none_match,
61 if_range,
62 if_unmodified_since,
63 range,
64 referer,
65 user_agent,
66 accept_ranges,
67 cookie = [],
68 keep_alive,
69 location,
70 content_length,
71 content_type,
72 content_encoding,
73 authorization,
74 transfer_encoding,
a1e2e74 @lefant add implementation of X-Forwarded-For header (Fabian Linzberger)
lefant authored
75 x_forwarded_for,
88996d8 @vinoski cosmetic comment and whitespace cleanup in yaws_api.hrl
vinoski authored
76 other = [] % misc other headers
d0caaf6 @klacke tabs cleanup
authored
77 }).
21abc5b @klacke Initial revision
authored
78
79
80
81
8da2b3a @klacke parse_url
authored
82 -record(url,
88996d8 @vinoski cosmetic comment and whitespace cleanup in yaws_api.hrl
vinoski authored
83 {scheme, % undefined means not set
84 host, % undefined means not set
85 port, % undefined means not set
d0caaf6 @klacke tabs cleanup
authored
86 path = [],
87 querypart = []}).
a1b8e0c Added set cookie parser
Johan Bevemyr authored
88
89
ba07506 @capflam Refactor Set-Cookie/Cookie header parsing to follow RFC6265
capflam authored
90 -record(setcookie, {key,
91 value,
92 quoted = false,
93 domain,
94 max_age,
95 expires,
96 path,
97 secure = false,
98 http_only = false,
99 extensions = []}).
100
101
102 -record(cookie, {key,
103 value,
104 quoted = false}).
3a8e071 @capflam Fix parse_set_cookie/1 and format_set_cookie/1 functions
capflam authored
105
106
883fa5a @klacke added redirect_self to yaws_api
authored
107 -record(redir_self, {
88996d8 @vinoski cosmetic comment and whitespace cleanup in yaws_api.hrl
vinoski authored
108 host, % string() - our own host
109 scheme, % http | https
110 scheme_str, % "https://" | "http://"
111 port, % integer() - our own port
112 port_str % "" | ":<int>" - the optional port part
113 % to append to the url
883fa5a @klacke added redirect_self to yaws_api
authored
114 }).
b2d5a00 @klacke postvar(), queryvar(), ssi docs
authored
115
39c8d49 @jbothma update WebSockets implementation to support RFC 6455
jbothma authored
116 %% Corresponds to the frame sections as in
117 %% http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-08#section-4
118 %% plus 'data' and 'ws_state'
119 -record(ws_frame_info, {
88996d8 @vinoski cosmetic comment and whitespace cleanup in yaws_api.hrl
vinoski authored
120 fin,
121 rsv,
122 opcode,
123 masked,
124 masking_key,
125 length,
126 payload,
127 data, % The unmasked payload. Makes payload redundant.
128 ws_state % The ws_state after unframing this frame.
129 % This is useful for the endpoint to know what type of
130 % fragment a potentially fragmented message is.
131 }).
132
133 %%----------------------------------------------------------------------
134 %% The state of a WebSocket connection.
135 %% This is held by the ws owner process and passed in calls to yaws_api.
136 %%----------------------------------------------------------------------
39c8d49 @jbothma update WebSockets implementation to support RFC 6455
jbothma authored
137 -type frag_type() :: text
88996d8 @vinoski cosmetic comment and whitespace cleanup in yaws_api.hrl
vinoski authored
138 | binary
139 | none. % The WebSocket is not expecting continuation
140 % of any fragmented message.
39c8d49 @jbothma update WebSockets implementation to support RFC 6455
jbothma authored
141 -record(ws_state, {
88996d8 @vinoski cosmetic comment and whitespace cleanup in yaws_api.hrl
vinoski authored
142 vsn :: integer(), % WebSocket version number
143 sock, % gen_tcp or gen_ssl socket
144 frag_type :: frag_type()
145 }).
Something went wrong with that request. Please try again.