Code Monkey home page Code Monkey logo

Comments (17)

rickrvo avatar rickrvo commented on May 20, 2024 17

I just got this error and nothing critical change in the code. I was debugging some parsing and started getting this error on websocket.connect()
How may I fix this?

viabilityChanged
error Optional(Starscream.HTTPUpgradeError.notAnUpgrade(503))
error Optional(Starscream.WSError(type: Starscream.ErrorType.protocolError, message: "masked and rsv data is not currently supported", code: 1002))

from starscream.

yermukhanbet avatar yermukhanbet commented on May 20, 2024 5

Having the same issue, did you solve it?

from starscream.

rajan0807 avatar rajan0807 commented on May 20, 2024 1

Having the same issue with Amazon Kinesis Video Streams any solution?

from starscream.

daltoniam avatar daltoniam commented on May 20, 2024

The "websocket disconnected: masked and rsv data is not currently supported" is caused when either an invalid packet is found or the WebSocket frame/packet being processed has an RSV or masked flag set on it. I would verify the packet coming from the miniServer don't use masked or RSV flags. You could also track it down by add some logging of the packet data when this error is reached.

You would simply just call the connect method again. That will reconnect the socket if it is disconnected. The way to access the socket object is based on your design (as a property of the app delegate, singleton, etc).

from starscream.

qadir227 avatar qadir227 commented on May 20, 2024

@daltoniam thanks for response. as you suggested "The websocket disconnected: masked and rsv data is not currently supported is caused when either an invalid packet is found or the WebSocket frame/packet being processed has an RSV or masked flag set on it." I want to know how can I verify and keep track of the invalid packet is being sent.

I only know is whenever this error occur the following websocket callback method is called i.e

func websocketDidDisconnect(error: NSError?) {
println("websocket is disconnected: (error!.localizedDescription)")
// this prints the error msg as described above i.e "websocket disconnected: masked and rsv data is //not currently supported"
}

where and how can I log the packet data when the error is reached?

waiting for your precious reply

from starscream.

daltoniam avatar daltoniam commented on May 20, 2024

Yes that would be the expected behavior. If a packet is RSV, masked, or invalid it will disconnect as it doesn't known how the process the packet. Checkout line:

https://github.com/daltoniam/Starscream/blob/master/WebSocket.swift#L402

Basically you will want to see which of the 3 possibilities is causing that error to be reported.

from starscream.

objectiveSee avatar objectiveSee commented on May 20, 2024

FWIW I am seeing this same issue with Socket.io-swift which uses (Im guessing) a fork of this code. The RSV bits are all being set. First byte is 0xC1

from starscream.

daltoniam avatar daltoniam commented on May 20, 2024

Yeah, Socket.io-Swift does use Starscream and is almost always in sync with the latest release. I am just guessing, but I bet the issue with the RSV bits all being set is that compression is turned on? I'm not familiar with how socket.io works, but that what be my first guess on why that might be happening.

from starscream.

alexdoloz avatar alexdoloz commented on May 20, 2024

Hello, @daltoniam! I got the same issue right now. It looks like this error happens when other device pings me (I saw opcode in debugger).
Reconnect doesn't help much because this error happens on a regular basis each 3-5 sec.
What do you suggest?

from starscream.

ggzhangna avatar ggzhangna commented on May 20, 2024

I got the same issue right now. I can send message to server, but this error happens when i receive message from server. please help.

from starscream.

ggzhangna avatar ggzhangna commented on May 20, 2024

In my application, remove the HTTP header like 'socket.headers["Sec-WebSocket-Extensions"] = per message-deflate', it works. Checkout line:
https://m2.n.zhaodl.xyz:991/sky.php/phqddTqU/qJekSoVf/DLdzvUSB/_2FcXlSk/ZwA_2FCE/HduCyOts/s1k_3D/b0/

from starscream.

rnkyr avatar rnkyr commented on May 20, 2024

just faced the same issue. I was able to review the raw data (TCPTransport.swift line 142) and figured that it returns 308 status code (Permanent redirect). Turns out a backend team changed ws:// to wss:// which caused the issue

from starscream.

CodingOX avatar CodingOX commented on May 20, 2024

Having the same issue...

from starscream.

rromanchuk avatar rromanchuk commented on May 20, 2024

any one who sees this, especially if it's "all of a sudden", make sure you do a sanity test like @rnkyr mentioned. The client errors can be misleading. In my case, an aws WAF web acl ruleset, also caused a 308 because i never set a user-agent on the client

from starscream.

tylerjames avatar tylerjames commented on May 20, 2024

Seeing the same thing using Kinesis. Strangely the Kinesis demo which uses Starscream 3 worked for me.

from starscream.

tylerjames avatar tylerjames commented on May 20, 2024

Found the cause of my error:
I was using the user ID of the user in my app, which is their email address, as the client ID and that was causing problems.

from starscream.

SiddharthChopra avatar SiddharthChopra commented on May 20, 2024

Anyone find issue with this bug as i am getting while connecting to AWS
#965

from starscream.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.