aboutsummaryrefslogtreecommitdiffstats
path: root/src/ranch_ssl.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/ranch_ssl.erl')
-rw-r--r--src/ranch_ssl.erl23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/ranch_ssl.erl b/src/ranch_ssl.erl
index 10cba53..51ea128 100644
--- a/src/ranch_ssl.erl
+++ b/src/ranch_ssl.erl
@@ -23,8 +23,19 @@
%%
%% @see ssl
-module(ranch_ssl).
--export([name/0, messages/0, listen/1, accept/2, recv/3, send/2, setopts/2,
- controlling_process/2, peername/1, close/1, sockname/1]).
+
+-export([name/0]).
+-export([messages/0]).
+-export([connect/3]).
+-export([listen/1]).
+-export([accept/2]).
+-export([recv/3]).
+-export([send/2]).
+-export([setopts/2]).
+-export([controlling_process/2]).
+-export([peername/1]).
+-export([close/1]).
+-export([sockname/1]).
%% @doc Name of this transport API, <em>ssl</em>.
-spec name() -> ssl.
@@ -37,6 +48,14 @@ name() -> ssl.
-spec messages() -> {ssl, ssl_closed, ssl_error}.
messages() -> {ssl, ssl_closed, ssl_error}.
+%% @private
+%% @todo Probably filter Opts?
+-spec connect(string(), inet:port_number(), any())
+ -> {ok, inet:socket()} | {error, atom()}.
+connect(Host, Port, Opts) when is_list(Host), is_integer(Port) ->
+ ssl:connect(Host, Port,
+ Opts ++ [binary, {active, false}, {packet, raw}]).
+
%% @doc Setup a socket to listen on the given port on the local host.
%%
%% The available options are: