Score:1

How to use smart websocket client from Windows to connect to a running websocket server on virtualbox?

sd flag

Here is my setup:

  1. Windows 8.1 with Ubuntu 18.04 within VirtuablBox 6.0
  2. Run a websocket server at 127.0.0.1:8083 within VirtuablBox
  3. Within the VirtuablBox, I can connect to the websocket server with websocat ws://127.0.0.1:8083

What is the setup I should use in order for me to connect to the websocket server through the Chrome extension(i.e Smart Websocket Client) running on Windows host machine.

I have tried to connect to '127.0.01:8083' within Smart Websocket Client, but the error is shown:

Failed to construct 'WebSocket': The URL '127.0.01:8083' is invalid.

Thank you

bjoster avatar
cn flag
Have you tried connecting from Windows to the IP-Adress of "VirtualBox" instead of the Windows localhost?
sd flag
The network of the virtualbox has Port Forwarding to 5678(Host Port) 127.0.0.1(Host IP) for SSH and I can connect putty running on windows to the virtualbox without problems. However, I didn't find a way that I could connect the websocket Chrome extension running on Windows to the virtualbox.
sd flag
Can someone tell me why I get vote-down on this question? What is the problem of this question posted here?
Score:1
ar flag

Configure a port forward in Virtualbox. Web sockets is a regular TCP stream, and there's no reason it should not work.

As noted you have port forwarding configured for SSH, so simply add another one for the websocket port.

sd flag
I added the following into the Port Forwarding Rules "Websocket, TCP, 127.0.0.1, 8083, 10.0.2.15, 23 for Name, Protocol, Host IP, Host Port, Guest IP, Guest Port", Then I used Smart Websocket Client on windows to connect to ws://127.0.0.1:8083. But it still doesn't work.
vidarlo avatar
ar flag
Is port 23 the correct guest port?
sd flag
How do I know whether the port 23 is correct? I just randomly selected one.
vidarlo avatar
ar flag
You can't ***randomly*** select a port and expect it to be the correct one! You have to know what port your service listens on, and use that port! You have to know your own configuration to manage to make complex systems work. SSH uses port 22, by default, but your websocket probably does not use port 23. You mention 8083 in your question, where did you get this from?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.