FedecksClient.Websockets.WebsocketUrl (fedecks_client v0.1.0)
Holds and validates websocket url in a way that is useful for using with Mint Websockets.
Struct values:
scheme
: either atoms:ws
or:wss
http_scheme
: if scheme is:ws
thenhttp
, otherwisehttps
. Used by establish the initialMint
connection before upgradeport
: the TCP port (obvs)path
: Path part of theurl (obvs)
Link to this section Summary
Functions
Parses and validates a String websocket url.
Link to this section Types
@type t() :: %FedecksClient.Websockets.WebsocketUrl{ host: term(), http_scheme: :http | :https, path: String.t(), port: non_neg_integer(), scheme: :ws | :wss }
Link to this section Functions
Link to this function
new(string_url)
Parses and validates a String websocket url.
- Only
ws
andwss
schemes are accepted. - Host is required.
- Port is dreived from the scheme, is not part of the url
- Path is normalised to "/" if it is absent