Skip to content

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

Closed as not planned
Closed as not planned

Description

@lyzhang1999

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

Activity

  1. added
    bugSomething isn't working
    triageThis issue needs to be triaged by a maintainer
    on Aug 3, 2022
  2. jsjoeio commented on Aug 4, 2022

    @jsjoeio
    Contributor

    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?

  3. added
    waiting-for-infoWaiting for more information from submitter
    and removed
    bugSomething isn't working
    triageThis issue needs to be triaged by a maintainer
    on Aug 4, 2022
  4. molszews commented on Aug 24, 2022

    @molszews

    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.

  5. jsjoeio commented on Aug 24, 2022

    @jsjoeio
    Contributor

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

  6. added
    needs-investigationThis issue needs to be further investigated
    and removed
    waiting-for-infoWaiting for more information from submitter
    on Aug 24, 2022
  7. code-asher commented on Aug 24, 2022

    @code-asher
    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.

  8. jsjoeio commented on Aug 24, 2022

    @jsjoeio
    Contributor

    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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions