Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 145 lines (127 sloc) 5.039 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, {
d0caaf6 @klacke tabs cleanup
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)
455578a @vinoski major trailing whitespace cleanup
vinoski authored
16 server_path, %% The normalized server path
d0caaf6 @klacke tabs cleanup
authored
17 %% (pre-querystring part of URI)
455578a @vinoski major trailing whitespace cleanup
vinoski authored
18 querydata, %% For URIs of the form ...?querydata
d0caaf6 @klacke tabs cleanup
authored
19 %% equiv of cgi QUERY_STRING
455578a @vinoski major trailing whitespace cleanup
vinoski authored
20 appmoddata, %% (deprecated - use pathinfo instead) the remainder
d0caaf6 @klacke tabs cleanup
authored
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
455578a @vinoski major trailing whitespace cleanup
vinoski authored
30 appmod_prepath, %% (deprecated - use prepath instead) path in front
d0caaf6 @klacke tabs cleanup
authored
31 %%of: <appmod><appmoddata>
455578a @vinoski major trailing whitespace cleanup
vinoski authored
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,
2fa66b0 @klacke cgi support
authored
35 %% or .yaws,.php,.cgi,.fcgi etc script file.
455578a @vinoski major trailing whitespace cleanup
vinoski authored
36 pathinfo %% Set to '/d/e' when calling c.yaws for the request
d0caaf6 @klacke tabs cleanup
authored
37 %% http://some.host/a/b/c.yaws/d/e
38 %% equiv of cgi PATH_INFO
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 arg_rewrite mods can now return HTTP responses (capflam)
Christopher Faulet 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,
d0caaf6 @klacke tabs cleanup
authored
76 other = [] %% misc other headers
77 }).
21abc5b @klacke Initial revision
authored
78
79
80
81
8da2b3a @klacke parse_url
authored
82 -record(url,
814bae1 @klacke cleaned up the redirect feature. It was poorly implemented and poorly…
authored
83 {scheme, %% undefined means not set
84 host, %% undefined means not set
d0caaf6 @klacke tabs cleanup
authored
85 port, %% undefined means not set
86 path = [],
87 querypart = []}).
a1b8e0c Added set cookie parser
Johan Bevemyr authored
88
89
90 -record(setcookie,{
455578a @vinoski major trailing whitespace cleanup
vinoski authored
91 key,
92 value,
93 quoted,
d0caaf6 @klacke tabs cleanup
authored
94 comment,
95 comment_url,
96 discard,
97 domain,
98 max_age,
99 expires,
100 path,
101 port,
102 secure,
103 version}).
a1b8e0c Added set cookie parser
Johan Bevemyr authored
104
dbab7a3 @klacke ssi include with var expansion + docs
authored
105
883fa5a @klacke added redirect_self to yaws_api
authored
106 -record(redir_self, {
107 host, %% string() - our own host
108 scheme, %% http | https
109 scheme_str, %% "https://" | "http://"
110 port, %% integer() - our own port
111 port_str %% "" | ":<int>" - the optional port part
112 %% to append to the url
113 }).
b2d5a00 @klacke postvar(), queryvar(), ssi docs
authored
114
39c8d49 @jbothma update WebSockets implementation to support RFC 6455
jbothma authored
115 %% Corresponds to the frame sections as in
116 %% http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-08#section-4
117 %% plus 'data' and 'ws_state'
118 -record(ws_frame_info, {
119 fin,
120 rsv,
121 opcode,
122 masked,
123 masking_key,
124 length,
125 payload,
126 data, %% The unmasked payload. Makes payload redundant.
127 ws_state %% The ws_state after unframing this frame.
128 %% This is useful for the endpoint to know what type of
129 %% fragment a potentially fragmented message is.
130 }).
131
132 %----------------------------------------------------------------------
133 % The state of a WebSocket connection.
134 % This is held by the ws owner process and passed in calls to yaws_api.
135 %----------------------------------------------------------------------
136 -type frag_type() :: text
137 | binary
138 | none. %% The WebSocket is not expecting continuation
139 %% of any fragmented message.
140 -record(ws_state, {
141 vsn :: integer(), % WebSocket version number
142 sock, % gen_tcp or gen_ssl socket
143 frag_type :: frag_type()
144 }).
Something went wrong with that request. Please try again.