Skip to content

ejscunha/gen_websocket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GenWebsocket

A websocket client based on gun with a similar API to gen_tcp.

Installation

The package can be installed by adding gen_websocket to your list of dependencies in mix.exs:

def deps do
  [
    {:gen_websocket, "~> 0.1.0"}
  ]
end

Usage

Below is a small example on how you can start a client and use it to send and receive data, and how to stop the client. See the full docs at https://hexdocs.pm/gen_websocket for more information.

{:ok, client} = GenWebsocket.connect('echo.websocket.org', 80)
:ok = GenWebsocket.send(client, "data")
{:ok, "data"} = GenWebsocket.recv(client, 0)
:ok = GenWebsocket.close(client)

Contributing

Contributions are welcome! Feel free to open an issue if you'd like to discuss a problem or a possible solution. Pull requests are much appreciated.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages