Repository navigation
[Bug]: built-in extensions "simple-browser" not work #5402
Description
Is there an existing issue for this?
- I have searched the existing issues
OS/Web Information
- Web Browser: Chrome
- Local OS: macOS
- Remote OS: Ubuntu
- Remote Architecture: amd64
code-server --version: 4.5.1
Steps to Reproduce
- create kind cluster
- deploy code-server with deployment
---
apiVersion: v1
kind: Service
metadata:
name: code-server
namespace: code-server
spec:
ports:
- port: 80
targetPort: 8080
selector:
app: code-server
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: code-server
name: code-server
namespace: code-server
spec:
selector:
matchLabels:
app: code-server
replicas: 1
template:
metadata:
labels:
app: code-server
spec:
containers:
- image: codercom/code-server:latest
imagePullPolicy: Always
name: code-server
env:
- name: PASSWORD
value: "your_password"
- port-forward code-server and access
- clone https://github.com/cyclic-software/starter-nextjs.git repo
- run yarn run dev, and use command+shift+p open sample browser
- access
127.0.0.1:3000, and it show connection refuse
Expected
This plugin is built-in plugin, and can access nextjs app in sample browser.
Actual
Connection refuse.
Logs
[2022-08-03T08:19:08.250Z] info Wrote default config file to ~/.config/code-server/config.yaml
[2022-08-03T08:19:08.462Z] info code-server 4.5.1 97d1703
[2022-08-03T08:19:08.462Z] info Using user-data-dir ~/.local/share/code-server
[2022-08-03T08:19:08.471Z] info Using config file ~/.config/code-server/config.yaml
[2022-08-03T08:19:08.471Z] info HTTP server listening on http://0.0.0.0:8080/
[2022-08-03T08:19:08.471Z] info - Authentication is enabled
[2022-08-03T08:19:08.471Z] info - Using password from $PASSWORD
[2022-08-03T08:19:08.471Z] info - Not serving HTTPS
[08:19:56] Extension host agent started.
[08:19:56] [127.0.0.1][6e69e306][ManagementConnection] Unknown reconnection token (never seen).
[08:19:56] [127.0.0.1][6413cb24][ExtensionHostConnection] Unknown reconnection token (never seen).
[08:19:58] [127.0.0.1][533e507c][ManagementConnection] New connection established.
[08:19:58] [127.0.0.1][d5653c2d][ExtensionHostConnection] New connection established.
[08:19:58] [127.0.0.1][d5653c2d][ExtensionHostConnection] <80> Launched Extension Host Process.
[08:20:10] Using the in-memory credential store as the operating system's credential store could not be accessed. Please see https://aka.ms/vscode-server-keyring on how to set this up. Details: Cannot find module '../build/Release/keytar.node'
Require stack:
- /usr/lib/code-server/lib/vscode/node_modules/keytar/lib/keytar.js
- /usr/lib/code-server/lib/vscode/out/bootstrap-amd.js
- /usr/lib/code-server/out/node/util.js
- /usr/lib/code-server/out/node/cli.js
- /usr/lib/code-server/out/node/entry.js
File not found: /usr/lib/code-server/lib/vscode/out/vs/workbench/contrib/webview/browser/pre/baidu.com
File not found: /usr/lib/code-server/lib/vscode/node_modules/vscode-regexp-languagedetection/dist/index.js
File not found: /usr/lib/code-server/lib/vscode/out/vs/workbench/contrib/webview/browser/pre/baidu.com
File not found: /usr/lib/code-server/lib/vscode/node_modules/@vscode/vscode-languagedetection/dist/lib/index.js.map
Screenshot/Video
Does this issue happen in VS Code or GitHub Codespaces?
- I cannot reproduce this in VS Code.
- I cannot reproduce this in GitHub Codespaces.
Are you accessing code-server over HTTPS?
- I am using HTTPS.
Notes
I'm not using HTTPS!!!!
When I use curl access 127.0.0.1:3000, it works, but can't access with sample browser.
Here is same issues but close. #3495

Activity
jsjoeio commentedon Aug 4, 2022
I cannot reproduce this locally using code-server 4.5.1 and Brave.
Screenshot
If you're deploying code-server via Kubernetes, wouldn't you need to forward 3000 as well?
molszews commentedon Aug 24, 2022
I think the expectation here is that the port-forward is not needed as long as you are trying to browse using the Simple Browser, so the traffic originates from pod to code-server and then the browser just renders it.
jsjoeio commentedon Aug 24, 2022
Ah, I understand now. Hmm...I'm not sure then 🤔 pinging @code-asher maybe @bpmct
code-asher commentedon Aug 24, 2022
The issue says it cannot be reproduced in Codespaces but it reproduces for me. I ran
python -m http.serverand then opened the simple browser tohttp://127.0.0.1:8000.The expectation makes sense to me but I believe the browser implementation is nothing more than an iframe so it will unfortunately resolve from your local machine.
To fix like @jsjoeio said I think you will need to forward port 3000. Or you could try opening the port through code-server's proxy instead like with
http://localhost:8080/proxy/3000/.If the simple browser extension proxied itself that would be ideal though.
jsjoeio commentedon Aug 24, 2022
Sadly, I don't think we can take action on this and there is a workaround, so I think it makes sense to close this. If there's more we can do to help, let us know!