Tuesday, August 9, 2022

VS Code editor in browser

 There are 2 options, basically:-

  • code-server
  • OpenVSCode

What's the difference? Excerpt from code-server's FAQ:-

code-server and OpenVSCode-Server both allow you to access VS Code via a browser. The two projects also use their own forks of VS Code to leverage modern VS Code APIs and stay up to date with the upsteam version.

However, OpenVSCode-Server is scoped at only making VS Code available in the web browser. code-server includes some other features:

  • password auth
  • proxy web ports
  • certificate support
  • plugin API
  • settings sync (coming soon)

 So I decided to try code-server. Installation is straightforward, as copied from the docs page:-

curl -fsSL https://code-server.dev/install.sh | sh

After that you can run it as:-

PORT=3000 code-server

To actually access that from my laptop, I just use ssh port forwarding:-

ssh -L 3000:localhost:3000 my-server

I can then access it through my browser at https://localhost:3000/. You'll need to copy password from ~/.config/code-server/config.yaml.

So far the experience is satisfying. It feels the same as in Github Codespaces.

No comments: