shokai / websocket-client-simple

Simple WebSocket Client on Ruby
https://rubygems.org/gems/websocket-client-simple
MIT License
115 stars 68 forks source link

How do you send headers when connecting to a web socket? #31

Open laredotornado opened 6 years ago

laredotornado commented 6 years ago

Hi,

Is it possible to send headers to the web socket when first making a connection? I was looking to replicate this code that uses curl ( https://gist.github.com/htp/fbce19069187ec1cc486b594104f01d0 ) using your web socket client.

sunchess commented 6 years ago

According the code https://github.com/shokai/websocket-client-simple/blob/master/lib/websocket-client-simple/client.rb#L32 WebSocket::Client::Simple.connect(URL, header: {your: "header"}) should work

unasuke commented 2 years ago

@laredotornado This repository was moved ruby-jp/websocket-client-simple. If you still need this, make pull request or issue to ruby-jp/websocket-client-simple again, thx.