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

Websocket over devtunnel is not working #291

Closed
flvcode opened this issue Aug 15, 2023 · 5 comments
Closed

Websocket over devtunnel is not working #291

flvcode opened this issue Aug 15, 2023 · 5 comments

Comments

@flvcode
Copy link

flvcode commented Aug 15, 2023

I am trying to connect a websocket over the devtunnel but the connection is not fully established.
I am trying using the wss:// protocol over the https:// endpoint.

Are websockets currently supported?

@derekbekoe
Copy link
Contributor

Yes websockets are supported.
Can you share more information to help us resolve your issue?

@flvcode
Copy link
Author

flvcode commented Aug 15, 2023

I am running a simple java websocket server locally on port 8080.
My websocket client is postman for testing purposes.

I can connect to ws://localhost:8080 with no issues.
Also I am able to use ngrok for this port but I want to switch to using devtunnels.

For devtunnels I use: wss://TUNNELID-8080.use.devtunnels.ms.
This tunnel has port 8080 set to auto.

Should I explicitly add the wss protocol for port 8080?

When trying to connect over devtunnels, I get the callback for connectionEstablished in my ws server but nothing after that.
No message can be received. Also no callback for closing the ws.
The connection never moves past Connecting in the postman client.

What am I missing?
What other details should I provide to help debug this issue?

Here is my verbose output:

HostSSH: Receiving #23 ChannelOpenMessage(ChannelType: client-ssh-session-stream, SenderChannel: 1)
ClientSSH: SshServerSession:34817906 ConnectAsync
HostSSH: Sending #23 ChannelOpenConfirmationMessage(RecipientChannel: 1)(SenderChannel: 1)
HostSSH: SshClientSession:33592719 OnChannelOpenCompleted(SshChannel(Type: client-ssh-session-stream, Id: 1, RemoteId: 1))
ClientSSH: Sending #0 KeyExchangeInitMessage
HostSSH: Receiving #26 ChannelWindowAdjustMessage(RecipientChannel: 1)(BytesToAdd: 4194343)
HostSSH: Sending #26 ChannelWindowAdjustMessage(RecipientChannel: 1)(BytesToAdd: 4194343)
ClientSSH: Local version: SSH-2.0-Microsoft.DevTunnels.Ssh_3.11, remote version: SSH-2.0-Microsoft.DevTunnels.Ssh_3.11
ClientSSH: Receiving #0 KeyExchangeInitMessage
ClientSSH: KeyExchange negotiation: Server (diffie-hellman-group16-sha512, diffie-hellman-group14-sha256) Client (ecdh-sha2-nistp384, ecdh-sha2-nistp256, diffie-hellman-group16-sha512, diffie-hellman-group14-sha256, ext-info-c) => diffie-hellman-group16-sha512
ClientSSH: PublicKey negotiation: Server (ecdsa-sha2-nistp384) Client (rsa-sha2-512, rsa-sha2-256, ecdsa-sha2-nistp384, ecdsa-sha2-nistp256) => ecdsa-sha2-nistp384
ClientSSH: ClientEncryption negotiation: Server (aes256-cbc, aes256-ctr) Client ([email protected], aes256-cbc, aes256-ctr) => aes256-cbc
ClientSSH: ServerEncryption negotiation: Server (aes256-cbc, aes256-ctr) Client ([email protected], aes256-cbc, aes256-ctr) => aes256-cbc
ClientSSH: ClientHmac negotiation: Server ([email protected], [email protected], hmac-sha2-512, hmac-sha2-256) Client ([email protected], [email protected], hmac-sha2-512, hmac-sha2-256) => [email protected]
ClientSSH: ServerHmac negotiation: Server ([email protected], [email protected], hmac-sha2-512, hmac-sha2-256) Client ([email protected], [email protected], hmac-sha2-512, hmac-sha2-256) => [email protected]
ClientSSH: ClientCompression negotiation: Server (none) Client (none) => none
ClientSSH: ServerCompression negotiation: Server (none) Client (none) => none
ClientSSH: Receiving #1 KeyExchangeDhInitMessage
ClientSSH: Sending #1 KeyExchangeDhReplyMessage
ClientSSH: Sending #2 NewKeysMessage
ClientSSH: Receiving #2 NewKeysMessage
ClientSSH: Sending #3 ExtensionInfoMessage([email protected]; server-sig-algs=rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp256; [email protected]; [email protected])
ClientSSH: SshServerSession:34817906 encrypted
ClientSSH: Receiving #3 ExtensionInfoMessage([email protected]; server-sig-algs=rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp256)
ClientSSH: Receiving #4 ServiceRequestMessage(Service: ssh-userauth)
ClientSSH: Sending #4 ServiceAcceptMessage(Service: ssh-userauth)
ClientSSH: Receiving #5 AuthenticationRequestMessage(Method: none, Username: tunnel)
ClientSSH: SshServerSession:34817906 Authenticating(Username: tunnel, Key: password)
ClientSSH: ClientNone authentication succeeded.
ClientSSH: Sending #5 AuthenticationSuccessMessage
ClientSSH: Sending #6 PortForwardRequestMessage(RequestType: tcpip-forward)(AddressToBind: localhost, Port: 3000)
ClientSSH: Sending #7 PortForwardRequestMessage(RequestType: tcpip-forward)(AddressToBind: localhost, Port: 5500)
ClientSSH: Sending #8 PortForwardRequestMessage(RequestType: tcpip-forward)(AddressToBind: localhost, Port: 8080)
ClientSSH: Receiving #6 SessionRequestSuccessMessage
ClientSSH: Receiving #7 SessionRequestSuccessMessage
ClientSSH: Receiving #8 SessionRequestSuccessMessage
ClientSSH: Receiving #9 ChannelOpenMessage(ChannelType: forwarded-tcpip, SenderChannel: 0)
ClientSSH: PortForwardingService forwarded channel #0 connection to 127.0.0.1:8080.
ClientSSH: Sending #9 ChannelOpenConfirmationMessage(RecipientChannel: 0)(SenderChannel: 0)
ClientSSH: SshServerSession:34817906 OnChannelOpenCompleted(SshChannel(Type: forwarded-tcpip, Id: 0, RemoteId: 0))

@derekbekoe
Copy link
Contributor

Is the tunnel (or the specific port 8080) set to public?

@flvcode
Copy link
Author

flvcode commented Aug 16, 2023

Yes. Here are my details

% devtunnel show

Tunnel ID             : {TUNNELID}.use

Name                  : 

Description           : 

Tags                  : 

Access control        : {+Anonymous [connect]}

Host connections      : 1

Client connections    : 0

Current upload rate   : 2639 bytes/s (limit: 5 MB/s)

Current download rate : 2415 bytes/s (limit: 5 MB/s)

Upload total          : 88 KB

Download total        : 66 KB

Ports                 : 3

  3000  auto  https://{TUNNELID}-3000.use.devtunnels.ms/  

  5500  auto  https://{TUNNELID}-5500.use.devtunnels.ms/  

  8080  auto  https://{TUNNELID}-8080.use.devtunnels.ms/  

Tunnel Expiration     : 30 days

@flvcode
Copy link
Author

flvcode commented Aug 31, 2023

Issue got solved without any changes on my end. Also no devtunnels update.

Maybe a network issue solved a reboot.

@flvcode flvcode closed this as completed Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants