Skip to content
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

[BUG] Devtools doesn't allow insecure websocket over a secure (https) page #438

Open
nireak opened this issue Aug 20, 2020 · 4 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@nireak
Copy link

nireak commented Aug 20, 2020

Hello

When I'm running the app over a secure (https) connection I get an error: "SecurityError: Failed to construct 'WebSocket': An insecure WebSocket connection may not be initiated from a page loaded over HTTPS." originating at src/Devtools.ts:33

this.ws = new WebSocket(`ws://${host}?name=${this.name}`)

How can I use from an https page?
perhaps changing the websocket protocol to a secure one ?

window.location.protocol === 'https' ? wss : ws

Or it is not as easy? Perhaps, although you change your code, it would need some kind of certificate, etc...

Thanks!

@nireak nireak added the bug Something isn't working label Aug 20, 2020
@eivindr
Copy link

eivindr commented Oct 4, 2020

It would help if the quick fix provided by nireak could be applied. You don't necessarily need to support wss directly in the devtools since one could create a simple websocket proxy (nginx/caddy etc). The proxy is then configured with certificates but pass the websocket unencrypted to devtools.

@christianalfoni
Copy link
Member

@eivindr @nireak Hi there!

What browser are you using? With Chrome you can connect from https to http websocket 😄

You should be able to set option: devtools: 'wss://localhost:3031' and do something like @eivindr suggests.

But yeah, this is a bit tricky... but works great with Chrome

@lavir
Copy link

lavir commented Jan 11, 2021

@christianalfoni are you sure that the protocol in devtools option can be overwritten?

this.ws = new WebSocket(`ws://${host}?name=${this.name}`)

@nireak
Copy link
Author

nireak commented Feb 6, 2021

Thanks for the suggestions but I haven't been able to implement them.

I'm using Chrome and Opera.

I wanted to use overmind devtools while developing at Amazon Cloud9 IDE that runs on a EC2 instance remotely. My running app has then some url like https://xxxxxxxxx.vfs.cloud9.us-east-1.amazonaws.com/.

I know it's a very specific use case. :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants