#Accessing the DebugRC Server on WSL

9 messages · Page 1 of 1 (latest)

heavy sand
#

Ok, so currently, I can use the DebugRC server with windows command line with

curl localhost:32270
and it works fine. However, I'd like to do development with the server in WSL because its my standard programming environment. I'm having issues currently with getting that to work.

I've done some research online and it turns out you can access the windows localhost in WSL by using "$(hostname).local" as part of your bash command

However, when I attempt to connect to the server and make any sort of request, it gives an error.

When using curl to do this, I get the error:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Bad Request</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Bad Request - Invalid Hostname</h2>
<hr><p>HTTP Error 400. The request hostname is invalid.</p>
</BODY></HTML>```

and when using nc, it successfully connects, and as soon as I type anything I get:
```$ nc "$(hostname).local" 32270 -vvv
Connection to DESKTOP-J9OMH8C.local (<wsl ip>) 32270 port [tcp/*] succeeded!
/
HTTP/1.1 400 Bad Request
Content-Type: text/html; charset=us-ascii
Server: Microsoft-HTTPAPI/2.0
Date: Wed, 21 Feb 2024 04:07:50 GMT
Connection: close
Content-Length: 326

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Bad Request</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Bad Request - Invalid Verb</h2>
<hr><p>HTTP Error 400. The request verb is invalid.</p>
</BODY></HTML>```

Is this an issue with me being dumb or does DebugRC not play nice with WSL?
heavy sand
#

ok the nc issue was me being stupid but now it gives me the same error as curl does

heavy sand
#

Seems like wsl2 has some major issues with this sort of thing actually, I'll try docker and see if that works

hybrid junco
#

wsl and networking is a pain in the ass

#

the wsl ip address is also different from your windows ip address

#

they use a virtual network adapter

#

you can see the difference if you ip a on linux and ipconfig on windows

fair bloom
#

also try reproducing this via a simple server on your host machine, it will make debugging easier

heavy sand
#

I seem to be having the same issue in the docker container now that I set it up