[Codespaces VS Code Extension] HTTP 400 (Bad Request) when connect to Codespace behind Proxy #129850
Replies: 2 comments
-
hello We are facing the same issue. According to our internal networking/proxy experts, the schema of the HTTP request needs to be corrected. Our proxy works with the CONNECT method only, but the GitHub Codespace extension plugin comes with the target URL directly instead of This is the wrong request schema we currently see being used: GET https://euw.rel.tunnels.api.visualstudio.com/tunnels/qxxxxx?includePorts=true&api-version=2023-09-27-preview
HTTP/1.1
Accept: application/json, text/plain, */*
Authorization: tunnel xxxx
User-Agent: Github-Codespaces-Extension/unknown Dev-Tunnels-Service-TypeScript-SDK/1.1.32
Accept-Encoding: gzip, compress, deflate, br
host: euw.rel.tunnels.api.visualstudio.com
Connection: Keep-Alive
HTTP/1.1 400 Bad Request So, the GitHub Codespace extension in VSCode must support the proxy CONNECT scheme HTTP method correctly. |
Beta Was this translation helpful? Give feedback.
-
Hey, I had the same issue when I was working on a public non-sensitive code space and I did the following adjustments and it did work out: go to setting (
|
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Bug
Body
Background
We are using Codespaces in a corporate environment. Regular Clients need to use a HTTP Proxy to access Internet Services.
The correct Proxy settings are configured in the Browser and the
http_proxy
/https_proxy
environment variables.VS Code Version: 1.90.2 (Windows)
Codespaces Extension Version: 1.16.23
Issue
I have no issues to use Codespaces within the Browser, but when using VS Code Desktop I run into a HTTP 400 (Bad Request) when trying while trying to reach
euw.rel.tunnels.api.virtualstudio.com
Analysis
I did some research by inspecting the network traffic with Wireshark. When using Codespace in the Browser, one can observe a successful HTTP
CONNECT
request toeuw-data.rel.tunnels.api.virtualstudio.com
with a HTTP 200 Response from the Proxy.However, when using VS Code Desktop there is a HTTP GET request towards the proxy to
euw.rel.tunnels.api.virtualstudio.com
with a 400 Bad Request from the Proxy:
--> I would not expect a GET request here, rather a CONNECT as seen in the Browser. A direct GET towards the Proxy does not makes sense.
A simple
curl -X GET euw.rel.tunnels.api.virtualstudio.com
from the same machine is successful (cURL will be aware of thehttps_proxy
environmental variable and will send CONNECT requests to the Proxy automatically).Beta Was this translation helpful? Give feedback.
All reactions