Comments (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.
Having the same issue, did you solve it?
from starscream.
Having the same issue with Amazon Kinesis Video Streams any solution?
from starscream.
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.
@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.
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.
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.
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.
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.
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.
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.
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.
Having the same issue...
from starscream.
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.
Seeing the same thing using Kinesis. Strangely the Kinesis demo which uses Starscream 3 worked for me.
from starscream.
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.
Anyone find issue with this bug as i am getting while connecting to AWS
#965
from starscream.
Related Issues (20)
- Support for visionOS HOT 1
- When can the callback of timeout be supported?
- Endless dependency resolution with Xcode 15.3b3
- Return the response body in HTTPUpgradeError "notAnUpgrade"
- Add suppressed labels to enums
- Getting viabilityChanged error while integration of Starscream Websocket lib
- How to identify which WebSocket closed
- NWProtocolTCP Crash HOT 5
- How to use the WebSocketServer
- podspec version incorrect starting from tag 4.0.5 HOT 1
- Connection reset by peer when open the vpn
- Changelog is missing
- Connecting breaks / takes longer when updating from 4.0.6 to 4.0.8
- Getting socket error after peer closed event, for a request made after 5 mins of socket inactivity.
- ITMS-91065: Missing signature
- issue with version 3.0.1 for testflight submission
- Starscream, an SDK that was identified in the documentation as a privacy-impacting third-party SDK.
- ADD signature to this version
- Set SNI when enabling CertificatePinning with WSEngine with TCPTransport
- Starscream
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from starscream.