Skip to content

[Bug]: built-in extensions "simple-browser" not work #5402

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
4 tasks done
lyzhang1999 opened this issue Aug 3, 2022 · 5 comments
Closed
4 tasks done

[Bug]: built-in extensions "simple-browser" not work #5402

lyzhang1999 opened this issue Aug 3, 2022 · 5 comments

Comments

@lyzhang1999
Copy link

lyzhang1999 commented Aug 3, 2022

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

  1. create kind cluster
  2. 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"
  1. port-forward code-server and access
  2. clone https://github.com/cyclic-software/starter-nextjs.git repo
  3. run yarn run dev, and use command+shift+p open sample browser
  4. 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

image

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

@lyzhang1999 lyzhang1999 added bug Something isn't working triage This issue needs to be triaged by a maintainer labels Aug 3, 2022
@jsjoeio
Copy link
Contributor

jsjoeio commented Aug 4, 2022

I cannot reproduce this locally using code-server 4.5.1 and Brave.

Screenshot

image

If you're deploying code-server via Kubernetes, wouldn't you need to forward 3000 as well?

@jsjoeio jsjoeio added waiting-for-info Waiting for more information from submitter and removed bug Something isn't working triage This issue needs to be triaged by a maintainer labels Aug 4, 2022
@molszews
Copy link

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
Copy link
Contributor

jsjoeio commented Aug 24, 2022

Ah, I understand now. Hmm...I'm not sure then 🤔 pinging @code-asher maybe @bpmct

@jsjoeio jsjoeio added needs-investigation This issue needs to be further investigated and removed waiting-for-info Waiting for more information from submitter labels Aug 24, 2022
@code-asher
Copy link
Member

The issue says it cannot be reproduced in Codespaces but it reproduces for me. I ran python -m http.server and then opened the simple browser to http://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
Copy link
Contributor

jsjoeio commented 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!

@jsjoeio jsjoeio closed this as not planned Won't fix, can't repro, duplicate, stale Aug 24, 2022
@code-asher code-asher removed the needs-investigation This issue needs to be further investigated label Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants