Updated yaws_api.hrl, prod configuration (to live alongside VBS).
This commit is contained in:
parent
b01421d45d
commit
38dc560686
2
Makefile
2
Makefile
@ -2,7 +2,7 @@ MODS = $(wildcard src/*.erl)
|
|||||||
BEAMS = $(MODS:src/%.erl=ebin/%.beam)
|
BEAMS = $(MODS:src/%.erl=ebin/%.beam)
|
||||||
TEST_MODS = $(wildcard test/*.erl)
|
TEST_MODS = $(wildcard test/*.erl)
|
||||||
TEST_BEAMS = $(TEST_MODS:test/%.erl=test/%.beam)
|
TEST_BEAMS = $(TEST_MODS:test/%.erl=test/%.beam)
|
||||||
TS_ROOT=/usr/lib/yaws/jdb-labs/timestamper
|
TS_ROOT=/usr/local/var/yaws/jdb-labs.com/timestamper
|
||||||
CWD = `pwd`
|
CWD = `pwd`
|
||||||
|
|
||||||
default: compile
|
default: compile
|
||||||
|
150
src/yaws_api.hrl
150
src/yaws_api.hrl
@ -1,41 +1,41 @@
|
|||||||
%%%----------------------------------------------------------------------
|
%%%----------------------------------------------------------------------
|
||||||
%%% File : yaws_api.hrl
|
%%% File : yaws_api.hrl
|
||||||
%%% Author : Claes Wikstrom <klacke@hyber.org>
|
%%% Author : Claes Wikstrom <klacke@hyber.org>
|
||||||
%%% Purpose :
|
%%% Purpose :
|
||||||
%%% Created : 24 Jan 2002 by Claes Wikstrom <klacke@hyber.org>
|
%%% Created : 24 Jan 2002 by Claes Wikstrom <klacke@hyber.org>
|
||||||
%%%----------------------------------------------------------------------
|
%%%----------------------------------------------------------------------
|
||||||
|
|
||||||
-author('klacke@hyber.org').
|
-author('klacke@hyber.org').
|
||||||
|
|
||||||
-record(arg, {
|
-record(arg, {
|
||||||
clisock, %% the socket leading to the peer client
|
clisock, % the socket leading to the peer client
|
||||||
client_ip_port, %% {ClientIp, ClientPort} tuple
|
client_ip_port, % {ClientIp, ClientPort} tuple
|
||||||
headers, %% headers
|
headers, % headers
|
||||||
req, %% request
|
req, % request
|
||||||
clidata, %% The client data (as a binary in POST requests)
|
clidata, % The client data (as a binary in POST requests)
|
||||||
server_path, %% The normalized server path
|
server_path, % The normalized server path
|
||||||
%% (pre-querystring part of URI)
|
% (pre-querystring part of URI)
|
||||||
querydata, %% For URIs of the form ...?querydata
|
querydata, % For URIs of the form ...?querydata
|
||||||
%% equiv of cgi QUERY_STRING
|
% equiv of cgi QUERY_STRING
|
||||||
appmoddata, %% (deprecated - use pathinfo instead) the remainder
|
appmoddata, % (deprecated - use pathinfo instead) the remainder
|
||||||
%% of the path leading up to the query
|
% of the path leading up to the query
|
||||||
docroot, %% Physical base location of data for this request
|
docroot, % Physical base location of data for this request
|
||||||
docroot_mount, %% virtual directory e.g /myapp/ that the docroot
|
docroot_mount, % virtual directory e.g /myapp/ that the docroot
|
||||||
%% refers to.
|
% refers to.
|
||||||
fullpath, %% full deep path to yaws file
|
fullpath, % full deep path to yaws file
|
||||||
cont, %% Continuation for chunked multipart uploads
|
cont, % Continuation for chunked multipart uploads
|
||||||
state, %% State for use by users of the out/1 callback
|
state, % State for use by users of the out/1 callback
|
||||||
pid, %% pid of the yaws worker process
|
pid, % pid of the yaws worker process
|
||||||
opaque, %% useful to pass static data
|
opaque, % useful to pass static data
|
||||||
appmod_prepath, %% (deprecated - use prepath instead) path in front
|
appmod_prepath, % (deprecated - use prepath instead) path in front
|
||||||
%%of: <appmod><appmoddata>
|
% of: <appmod><appmoddata>
|
||||||
prepath, %% Path prior to 'dynamic' segment of URI.
|
prepath, % Path prior to 'dynamic' segment of URI.
|
||||||
%% ie http://some.host/<prepath>/<script-point>/d/e
|
% ie http://some.host/<prepath>/<script-point>/d/e
|
||||||
%% where <script-point> is an appmod mount point,
|
% where <script-point> is an appmod mount point,
|
||||||
%% or .yaws,.php,.cgi,.fcgi etc script file.
|
% or .yaws,.php,.cgi,.fcgi etc script file.
|
||||||
pathinfo %% Set to '/d/e' when calling c.yaws for the request
|
pathinfo % Set to '/d/e' when calling c.yaws for the request
|
||||||
%% http://some.host/a/b/c.yaws/d/e
|
% http://some.host/a/b/c.yaws/d/e
|
||||||
%% equiv of cgi PATH_INFO
|
% equiv of cgi PATH_INFO
|
||||||
}).
|
}).
|
||||||
|
|
||||||
|
|
||||||
@ -47,6 +47,10 @@
|
|||||||
status,
|
status,
|
||||||
phrase}).
|
phrase}).
|
||||||
|
|
||||||
|
-record(rewrite_response, {status,
|
||||||
|
headers = [],
|
||||||
|
content = <<>>}).
|
||||||
|
|
||||||
-record(headers, {
|
-record(headers, {
|
||||||
connection,
|
connection,
|
||||||
accept,
|
accept,
|
||||||
@ -68,45 +72,83 @@
|
|||||||
content_encoding,
|
content_encoding,
|
||||||
authorization,
|
authorization,
|
||||||
transfer_encoding,
|
transfer_encoding,
|
||||||
other = [] %% misc other headers
|
x_forwarded_for,
|
||||||
|
other = [] % misc other headers
|
||||||
}).
|
}).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-record(url,
|
-record(url,
|
||||||
{scheme, %% undefined means not set
|
{scheme, % undefined means not set
|
||||||
host, %% undefined means not set
|
host, % undefined means not set
|
||||||
port, %% undefined means not set
|
port, % undefined means not set
|
||||||
path = [],
|
path = [],
|
||||||
querypart = []}).
|
querypart = []}).
|
||||||
|
|
||||||
|
|
||||||
-record(setcookie,{
|
-record(setcookie, {key,
|
||||||
key,
|
value,
|
||||||
value,
|
quoted = false,
|
||||||
quoted,
|
domain,
|
||||||
comment,
|
max_age,
|
||||||
comment_url,
|
expires,
|
||||||
discard,
|
path,
|
||||||
domain,
|
secure = false,
|
||||||
max_age,
|
http_only = false,
|
||||||
expires,
|
extensions = []}).
|
||||||
path,
|
|
||||||
port,
|
|
||||||
secure,
|
-record(cookie, {key,
|
||||||
version}).
|
value,
|
||||||
|
quoted = false}).
|
||||||
|
|
||||||
|
|
||||||
-record(redir_self, {
|
-record(redir_self, {
|
||||||
host, %% string() - our own host
|
host, % string() - our own host
|
||||||
scheme, %% http | https
|
scheme, % http | https
|
||||||
scheme_str, %% "https://" | "http://"
|
scheme_str, % "https://" | "http://"
|
||||||
port, %% integer() - our own port
|
port, % integer() - our own port
|
||||||
port_str %% "" | ":<int>" - the optional port part
|
port_str % "" | ":<int>" - the optional port part
|
||||||
%% to append to the url
|
% to append to the url
|
||||||
}).
|
}).
|
||||||
|
|
||||||
|
%% Corresponds to the frame sections as in
|
||||||
|
%% http://tools.ietf.org/html/rfc6455#section-5.2
|
||||||
|
%% plus 'data' and 'ws_state'. Used for incoming frames.
|
||||||
|
-record(ws_frame_info, {
|
||||||
|
fin,
|
||||||
|
rsv,
|
||||||
|
opcode,
|
||||||
|
masked,
|
||||||
|
masking_key,
|
||||||
|
length,
|
||||||
|
payload,
|
||||||
|
data, % The unmasked payload. Makes payload redundant.
|
||||||
|
ws_state % The ws_state after unframing this frame.
|
||||||
|
% This is useful for the endpoint to know what type of
|
||||||
|
% fragment a potentially fragmented message is.
|
||||||
|
}).
|
||||||
|
|
||||||
|
%% Used for outgoing frames. No checks are done on the validity of a frame. This
|
||||||
|
%% is the application's responsability to send valid frames.
|
||||||
|
-record(ws_frame, {
|
||||||
|
fin = true,
|
||||||
|
rsv = 0,
|
||||||
|
opcode,
|
||||||
|
payload = <<>>
|
||||||
|
}).
|
||||||
|
|
||||||
|
%%----------------------------------------------------------------------
|
||||||
|
%% The state of a WebSocket connection.
|
||||||
|
%% This is held by the ws owner process and passed in calls to yaws_api.
|
||||||
|
%%----------------------------------------------------------------------
|
||||||
|
-type frag_type() :: text
|
||||||
|
| binary
|
||||||
|
| none. % The WebSocket is not expecting continuation
|
||||||
|
% of any fragmented message.
|
||||||
|
-record(ws_state, {
|
||||||
|
vsn :: integer(), % WebSocket version number
|
||||||
|
sock, % gen_tcp or gen_ssl socket
|
||||||
|
frag_type :: frag_type()
|
||||||
|
}).
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
ebin_dir = /usr/lib/yaws/jdb-labs/timestamper/ebin
|
ebin_dir = /usr/local/var/yaws/jdb-labs.com/timestamper/ebin
|
||||||
include_dir = /usr/lib/yaws/jdb-labs/timestamper/include
|
include_dir = /usr/local/var/yaws/jdb-labs.com/timestamper/include
|
||||||
|
|
||||||
runmod = timestamper
|
#runmod = timestamper
|
||||||
|
|
||||||
<server timestamper.jdb-labs.com>
|
<server timestamper.jdb-labs.com>
|
||||||
port = 80
|
port = 80
|
||||||
listen = 0.0.0.0
|
listen = 0.0.0.0
|
||||||
docroot = /usr/lib/yaws/jdb-labs/timestamper/www
|
docroot = /usr/local/var/yaws/jdb-labs.com/timestamper/www
|
||||||
appmods = ts_api
|
appmods = ts_api
|
||||||
</server>
|
</server>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user