-
Notifications
You must be signed in to change notification settings - Fork 6.3k
-
Hi,
I am using code-server under Docker (Linuxserver docker compose). The docker is running on a computer that has no direct internet, so I use http_proxy to access a local proxy. I can search and install extensions in code-server no problem, but the issue is that the extensions, and the extension details tabs don't seem to respect http_proxy setting. I can also use the code-server terminal to install systemwide apps using "apt install" Clearly the container can access the internet.
Here is the error when I click an extension to see the details in the extensions tab. Bear in mind that I was able to install "zaaack/markdown-editor" successfully, but the details page is empty and throws the error. I also have issues with extensions that require signing in, I suspect that the http_prooxy/dns settings aren't passed down to these tools.
GET https://open-vsx.org/vscode/asset/zaaack/markdown-editor/0.1.9/Microsoft.VisualStudio.Services.Icons.Default?targetPlatform=universal net::ERR_ADDRESS_UNREACHABLE
log.ts:445 ERR 'crypto.subtle' is not available so webviews will not work. This is likely because the editor is not running in a secure context (https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts).: Error: 'crypto.subtle' is not available so webviews will not work. This is likely because the editor is not running in a secure context (
code-server: v4.96.2
Code: 1.96.2
Commit: 08cbdfbdf11925e8a14ee03de97b942bba7e8a94
Date: 2024年12月19日T21:23:46.441Z (3 days ago)
docker-compose.yaml
environment:
- https_proxy=http://192.168.2.100:8118
- http_proxy=http://192.168.2.100:8118
dns:
- "192.168.2.100"
settings.json
"http.proxy": "http://192.168.2.100:8118",
"https.proxy": "http://192.168.2.100:8118",
"http.proxyStrictSSL": false,
curl https://open-vsx.org
in the code-server terminal
<!DOCTYPE html>
<html lang="en">
<head>
<title>Open VSX Registry</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-5WLCZXC');</script>
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 4 replies
-
One thing to note is that the details page uses web views, which require service workers, which browsers only allow in a secure context (https or localhost), so this might be having some effect. I believe all web view requests actually are meant to route through service workers and go through the web socket, so the request errors can be misleading.
There could also be proxy issues though; what do you have set for http.proxySupport
? That can have an effect on whether the proxy is used for extensions, I believe.
But, I have also seen that some extensions with sign-in only work in desktop VS Code, so that could also be part of the problem. One indicator is whether the extensions work in Codespaces, if they do then it could be either the proxy or even something wrong with code-server itself. We have to patch a few things to make secrets work, and it could be that something changed in VS Code that we need to account for or we did not do it quite right.
Beta Was this translation helpful? Give feedback.
All reactions
-
❤️ 1
-
Thanks for the reply. The signin issue was just another one, it isn't the real issue. As I mentioned just trying to open the extension details page doesn't work. What you said about the web views might be the real issue, it sounds like the proxy isn't supported there. The basic proxy seems to work for downloading and installing stuff.
(using Privoxy Http proxy)
"http.proxy": "http://192.168.2.100:8118",
"https.proxy": "http://192.168.2.100:8118",
"http.proxyStrictSSL": false,
"http.proxySupport": "on",
Here is the broken page for Python extension
Beta Was this translation helpful? Give feedback.
All reactions
-
That page will not work until you run in a secure context, so I would try running with https first. If it still fails at that point, then it could be proxy related.
Beta Was this translation helpful? Give feedback.
All reactions
-
What do you mean by secure context? Do you mean running code-server behind a HTTPS reverse-proxy?
Beta Was this translation helpful? Give feedback.
All reactions
-
Yes, that would do it. Browsers consider a context to be secure if is either https or localhost.
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1