-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Websocket problems, wrong PONG response #242
Comments
What was the obscure error? |
wsRead="websocket: close 1008 (policy violation): {"code":-1,"msg":"Illegal format ws or stream"}" I guess it has to do with the PING/PONG control frame. HTTP.WebSockets sends back a pong control frame which is not expected |
with the java websocket I can connect to binance url perfectly with no errors, with my proxy in between I got the control frame error proxy is running fine : https://websocket.org/echo.html with ws://localhost:8887 works also, got data without disconnecting |
this happens eventually after 5 min or less.
|
Were you able to resolve this Dennis? |
nope , got the date via timed rest call less optimal but working; Can you verify that this is also happening on your end? I am on a macbook pro btw |
Not able to verify this at the moment. But I did want to work on something very similar. I still am not sure which version of websockets to use. The one from HTTP.jl or Websockets.jl? The use case is similar to yours. Connect to binance, stream some quotes into a Julia stuct and read the value of that struct anytime a change occurs. |
I will give websockets.jl a try :-) |
helas, DandelionWebsockets forces to use outdated TLS packages, so still an issue |
closing issue because 1011 code wit close event is send via binance |
dug a little deeper, the reponse PONG message is incorrect so it seems, after three ping messages the HTTP.jl gives up? Can it be thate the reponse applicationdata is incorrect with regards to the ping data, see specification 👍 The Pong frame contains an opcode of 0xA. Section 5.5.2 details requirements that apply to both Ping and Pong A Pong frame sent in response to a Ping frame must have identical WebSocket ➡️ WebSocketHeader(TEXT | FINAL, 311-byte payload) base64data decoded 👍 |
Bump |
I think the solution is to remove the WebSockets code from HTTP.jl. There have been failing tests for several months now and no one who was originally involved in adding support for that code has been able to respond. The WebSockets.jl package is fully functioning and better maintained at this point than the HTTP.WebSockets code, so I think we should delete it unless someone can step up and make it work. cc: @samoconnor @EricForgy |
Hi @DennisRutjes, can you try out 5914a0e and let me know if that helps? |
@samoconnor that fixed it! I am getting steady results Thanks for addressing this issue, to me it was a real pain! |
I know this is closed, but I just want to throw out my opinion. The error message is: Per the Binance API, for multiple streams the format instead needs to be: I've received similar error response from Binance and it has always been a typo in my websocket URI. |
Julia 0.6.2
HTTP.jl 0.6.9
MbedTLS.jl 0.5.8
Trying to connect to Binance API : wss://stream.binance.com:9443/ws/trxbtc@kline_15m/xvgbtc@kline_15m/ncashbtc@kline_15m/iostbtc@kline_15m/stormbtc@kline_15m/zilbtc@kline_15m/adabtc@kline_15m/poebtc@kline_15m/xrpbtc@kline_15m/xlmbtc@kline_15m/funbtc@kline_15m/tnbbtc@kline_15m
HTTP.WebSockets.open(url; verbose = true) do io
while !eof(io);
put!(channel, r2j(readavailable(io)))
end
resulted in an obscure error on binance part.
I used a working java client with the same URL and proxied the socket results via an own java websocket server and tried to connect via localhost "ws://localhost:8887" to this ws server.
then the same error occured, but now on the "java" side it said
org.java_websocket.exceptions.InvalidFrameException: Control frame cant have fin==false set
Is there a way to debug/test the Websocket implementation to address this behaviour
The text was updated successfully, but these errors were encountered: