Skip to main content

Ralsina.Me — Roberto Alsina's website

Exposing Code-Server on a VPN

I have all my com­put­ers in a Tailscale VPN which means I can see them all as if I were di­rect­ly con­nect­ed to them.

Re­cent­ly I got a new desk­top com­put­er which is, for my stan­dard­s, ridicu­lous­ly fast. So, it makes sense to de­vel­op things in it even when I am not in front of it.

Since VS Code is ba­si­cal­ly a web ap­p, the idea is to use code serv­er run­ning in it and ac­cess it via VP­N.

Did it work? OH YES.

Per­for­mance is prac­ti­cal­ly the same as run­ning VS code lo­cal­ly, sim­i­lar to us­ing GitHub codespaces.

Did it need any spe­cial con­fig?

Just one. To make Chrome stop com­plain­ing about "in­se­cure con­tex­t", it needs to be ac­cessed via HTTP­S, even when it's done over a com­plete­ly en­crypt­ed tun­nel.

Luck­i­ly, it's very, very easy.

So, just get caddy, and use this Caddyfile:

mindy.tailABCDEF.ts.net

reverse_proxy :8088

Yes. Two lines. The ABCDEF part will be dif­fer­ent for each tailscale net­work.

And that's it. Ac­cess it us­ing http­s://­mindy.­tail­ABCDE­F.t­s.net and ... that's al­l. I am shocked at how well it worked, and how easy it was.


Contents © 2000-2024 Roberto Alsina