triniwiz / triniwiz/nativescript-plugins
Error when connecting to socket server on iOS only [@triniwiz/nativescript-socketio]
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 87
- Forks
- 57
- Avg merge
- 1h 36m
- Merged PRs (30d)
- 4
Description
Hi
I'm trying to use the plugin on iOS but it fails to connect to the socket server with error message:
error: error Invalid HTTP upgrade. code=308, type=upgradeError
ns version:
{
"dependencies": {
"@nativescript/core": "^8.4.1",
"@triniwiz/nativescript-socketio": "^4.0.3",
},
"devDependencies": {
"@nativescript/android": "~8.4.0",
"@nativescript/ios": "8.4.0",
"@nativescript/types": "~8.4.0",
"@nativescript/webpack": "~5.0.9",
"typescript": "~4.8.3"
}
}
My Code:
let options = {
transports: ['websocket'],
query: {
room: roomName,
token: 'XXX',
},
android: {
},
ios: {
log: true,
}
}
DOService.MySocket = new SocketIO(domain, options);
DOService.MySocket.connect();
DOService.MySocket.on('connect', function () {
DOService.socketConnected = true;
console.log('connected', DOService.socketConnected);
});
DOService.MySocket.on('disconnect', function (data) {
console.log('disconnect', data);
DOService.socketConnected = false;
});
DOService.MySocket.on('error', function (error) {
console.dir('error', error);
});
Can Anybody help?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the SocketIO constructor and connect() call shown in the issue, reproducing the connection on iOS with the supplied package versions and transports setting. Investigate the Invalid HTTP upgrade 308 response and compare the iOS behavior with the server's expected socket endpoint. Done means the iOS client connects successfully without the upgrade error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, typescript
- Domain
- mobile, networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100