Skip to content

Commit

Permalink
Add HTTPS Proxy Test (microsoft/vscode#235410)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrmarti committed Dec 5, 2024
1 parent 471fd7a commit bc806c6
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 1 deletion.
1 change: 1 addition & 0 deletions .devcontainer/https-proxy-test/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mitmproxy-config
13 changes: 13 additions & 0 deletions .devcontainer/https-proxy-test/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "mitmweb",
"type": "shell",
"command": "mitmweb --web-host '*'",
"runOptions": {
"runOn": "folderOpen"
}
}
]
}
9 changes: 9 additions & 0 deletions .devcontainer/https-proxy-test/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## HTTPS Proxy Test

- `Dev Containers: Reopen in Container` > `HTTPS Proxy Test`.
- First time: Install the certificate from `.devcontainer/https-proxy-test/mitmproxy-config` in the OS and restart VS Code. See https://docs.mitmproxy.org/stable/concepts-certificates/#installing-the-mitmproxy-ca-certificate-manually.
- Add the user setting `"http.proxy": "https://localhost:8080"`.
- Install GitHub Copilot Chat and use `Developer: GitHub Copilot Chat Diagnostics` to test connections with a HTTPS proxy. Use a second window to test connections from a local extension host.
- Verify in the log terminal of the dev container that the proxy is being used.

Note: Due to an issue in mitmproxy, Electron's `fetch` currently doesn't work. Add the user setting `"github.copilot.advanced.debug.useElectronFetcher": false` as a workaround.
6 changes: 6 additions & 0 deletions .devcontainer/https-proxy-test/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "HTTPS Proxy Test",
"dockerComposeFile": "docker-compose.yml",
"service": "devcontainer",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}/.devcontainer/https-proxy-test"
}
12 changes: 12 additions & 0 deletions .devcontainer/https-proxy-test/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: '3.4'

services:
devcontainer:
image: mitmproxy/mitmproxy
volumes:
- ../../..:/workspaces
- ./mitmproxy-config:/root/.mitmproxy
ports:
- "127.0.0.1:8080:8080"
- "127.0.0.1:8081:8081"
command: sleep inf
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.vscode
node_modules
*.pem
out
Expand Down

0 comments on commit bc806c6

Please sign in to comment.