infinitered / infinitered/reactotron

App not working with a custom socket

Open
#1,169 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
15.6k
Forks
972
PR merge metrics
No merged PRs in 30d

Description

I just updated reactotron packages in my React project and I see that you switched from node's "ws" package to native browser's WebSocket implementation.
The problem is when I try to use Reactotron on dev environment (which is HTTPS) and it's trying to connect to localhost's Reactotron app via HTTP using WebSocket, the "SecurityError" is thrown in the browser.

To solve this problem I tried to use custom socket, using "createSocket" property:
```javascript
import * as WebSocket from 'ws';
ReactotronJS.configure({ createSocket: path => new WebSocket(path) });
```
But using this custom socket returns error status code from Reactotron app: ```426 Upgrade required```.

How can I solve that to be able to use Reactotron when there are different security protocols?

Current version Reactotron app (Windows): 2.17.1
Current version of packages: reactotron-react-js: 3.3.7
Previous version of packages: reactotron-react-js: 1.13.0

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the HTTPS development setup described in the issue, including ReactotronJS.configure with the custom ws socket, and inspect the Reactotron app's 426 Upgrade Required response. Done means identifying a supported connection approach that lets the React project connect to the Reactotron desktop app across different security protocols.

Written by the indexing model from the issue text.

Assessment

Tech stack
react
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.