anchor.diff:  
   % "wss://push.planetside2.com/streaming?environment=ps2&service-id=s:example"
   
  -init([undefined, Opts]) ->
  -	init([]);
  -	
  -init([Url, undefined]) ->
  -	init();
  -	
  -init([Url, Opts]) ->
  -	SchemeDefs = http_uri:scheme_defaults() ++ [{ws, 80}, {wss, 443}],
  -
  -    case http_uri:parse(Url, [{scheme_defaults, SchemeDefs}]) of
  -		{error, Reason} ->
  -			{stop, {bad_format, Reason}}
  -			
  -	;	{ok, {Scheme, _Userinfo, Host, Port, ParseHeaders, ParseBody} } ->
  -			{ok, Pid} = gun:open(Host, Port),
  -			Mref = monitor(process, Pid),
  -    
  -			{ ok
  -			, #state{ gunner = Pid
  -					, mref = Mref
  -					, host = Host
  -					, port = Port
  -					, request = ParseHeaders ++ ParseBody
  -					}
  -			}
  -	end.
  -
  +
  +init([CallbackModule, Url, Opts]) ->
  +    process_flag(trap_exit, true),
  +
  +    behaviour:assert(CallbackModule, port_server),
  +    
  +    try
  +        BaseOpts =  case CallbackModule:websock_info() of
  +                        undefined           -> undefined
  +                    ;   X1 when is_list(X1) -> X1
  +                    ;   _                   -> throw({error, invalid_wbsock_info})
  +                    end,
  +        
  +        SchemeDefs = http_uri:scheme_defaults() ++ [{ws, 80}, {wss, 443}],
  +        
  +        TargetUrl = case {Url, proplists:get_value(url, BaseOpts, undefined)} of
  +                        {undefined, undefined}  -> throw({error, no_valid_url})
  +                    ;   {undefined, X2}         -> X2
  +                    ;   {_, _}                  -> Url
  +                    end,
  +        
  +        case http_uri:parse(TargetUrl, [{scheme_defaults, SchemeDefs}]) of
  +            {error, Reason} ->
  +                {stop, {bad_format, Reason}}
  +                
  +        ;   {ok, {Scheme, _Userinfo, Host, Port, ParseHeaders, ParseBody} } ->
  +                {ok, Pid} = gun:open(Host, Port),
  +                Mref = monitor(process, Pid),
  +        
  +                { ok
  +                , #state{ gunner = Pid
  +                        , mref = Mref
  +                        , host = Host
  +                        , port = Port
  +                        , mode = disconnected
  +                        , request = ParseHeaders ++ ParseBody
  +                        , options = xproplists:merge(BaseOpts, Opts)
  +                        }
  +                }
  +        end
  +    catch exit:Why ->
  +        {stop, Why, #state{}}
  +    end.
   
       
   %%%%% ------------------------------------------------------- %%%%%
  
positive.code: -include_lib("erlangx/include/supervisors.hrl").
  
  
  -export([start_link/0, child_spec/2]).
  -export([init/1, handle_call/3, handle_cast/2, handle_info/2,
           terminate/2, code_change/3]).
  
  
negative.code:     , request                           :: string()
      , mode          = disconnected      :: client_mode()
      , json_decode   = false             :: boolean()
      , options       = []                :: [proplists:property()]
      }).
  
      
  