|
|
@ -1,10 +1,10 @@ |
|
|
|
-module(elli). |
|
|
|
|
|
|
|
-behaviour(gen_server). |
|
|
|
|
|
|
|
-include("eWSrv.hrl"). |
|
|
|
-include("wsCom.hrl"). |
|
|
|
|
|
|
|
%% API |
|
|
|
-export([start_link/0, |
|
|
|
start_link/1, |
|
|
|
stop/1, |
|
|
@ -14,9 +14,14 @@ |
|
|
|
set_callback/3 |
|
|
|
]). |
|
|
|
|
|
|
|
%% gen_server callbacks |
|
|
|
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, |
|
|
|
terminate/2, code_change/3]). |
|
|
|
-export([ |
|
|
|
init/1 |
|
|
|
, handle_call/3 |
|
|
|
, handle_cast/2 |
|
|
|
, handle_info/2 |
|
|
|
, terminate/2 |
|
|
|
, code_change/3 |
|
|
|
]). |
|
|
|
|
|
|
|
-export_type([req/0, http_method/0, body/0, headers/0, response_code/0]). |
|
|
|
|
|
|
@ -125,8 +130,8 @@ init([Opts]) -> |
|
|
|
UseSSL = proplists:get_value(ssl, Opts, false), |
|
|
|
KeyFile = proplists:get_value(keyfile, Opts), |
|
|
|
CertFile = proplists:get_value(certfile, Opts), |
|
|
|
SockType = ?IF(UseSSL, ssl, plain), |
|
|
|
SSLSockOpts = ?IF(UseSSL, |
|
|
|
SockType = ?IIF(UseSSL, ssl, plain), |
|
|
|
SSLSockOpts = ?IIF(UseSSL, |
|
|
|
[{keyfile, KeyFile}, {certfile, CertFile}], |
|
|
|
[]), |
|
|
|
|
|
|
|