ngrok
ngrok copied to clipboard
How to connect to websocket ws
In my Android app, I'm connecting to websocket as:
val uri = URI("ws://a501045e.ngrok.io:8080/ws")
How can I run ngrok
to get the ws://
subdomain instead of the http://
one.
I tried changing the code in Android to be:
val uri = URI("tcp://0.tcp.ngrok.io:18972/ws")
And run ngrok
as:
ngrok tcp 8080
to get the connection as in the screenshot below.
But could not get the ws
signal at my computer:
var socket = new WebSocket("ws://127.0.0.1:8080/ws");
// var socket = new WebSocket("ws://localhost:8080/ws");
None of the above worked, knowing that both worked perfectly with Android emulator, once I defined the connection call as:
val uri = URI("tcp://10.0.2.2:8080/ws")
Don't give val uri = URI("tcp://0.tcp.ngrok.io:18972/ws")
instead try val uri = URI("ws://0.tcp.ngrok.io:18972/ws")
because its still web socket connection.
mihir09
Hello, do you have a solution on HTTPS websites?
as ws
doesn't work no more (Failed to construct 'WebSocket': An insecure WebSocket connection may not be initiated from a page loaded over HTTPS.)
I understood that the socket must be available over WSS, I tried to changed to wss://
but it failed
Same problem here, My browser is complaining about the security handshake not being the correct length.
exposing a ws:// over tcp with ngrok, accessing it over wss;// in the client is not working
Thank you for opening this issue! As of April 2016, the ngrok service has permanently moved to https://ngrok.com/. To join the community and file bug reports or feature enhancements for the ngrok agent, please go to https://github.com/ngrok/ngrok.
This repository is no longer actively maintained and will be archived soon to reduce confusion with the latest ngrok versions. We thank you for the continued support of ngrok and look forward to seeing you over at ngrok.com and the ngrok Community Repo.