Using VSCode Web Server Variant

Last tested version is 1.67.2, may become invalid in a future version.

Why & Why Not?




First, the download link is server-win32-x64-web and server-linux-x64-web. {target} /stable

Create directory named vscode with folder data, inner and misc.

Extract the package to inner, the you can directly execute ./inner/

To change data directory, use custom token and port, ./

./inner/bin/ --port=8109 --connection-token=mytoken

But a lot of inconvenience here, such as build tasks always fail when offline. So there is a patch ./misc/patch.js:

"use strict"; // Last Tested Version: 1.67.2
const patch = (path, replaceList) => {
  const fs = require("fs");
  const filePath = require("path").join(__dirname, "../inner", path);
  const bakPath = filePath + `.bak`;
  if (!fs.existsSync(bakPath)) fs.renameSync(filePath, bakPath);
  let content = fs.readFileSync(bakPath).toString();
  for (const [search, value] of replaceList) {
    const fn = search instanceof RegExp ? "replace" : "replaceAll";
    content = content[fn](search, value);
  fs.writeFileSync(filePath, content);
  console.log("patched: " + path);
patch("./out/vs/workbench/workbench.web.main.js", [
  // Webview: replaced with local server to allow offline work
patch("./out/vs/workbench/contrib/webview/browser/pre/main.js", [
  // Webview: bypass hostname vertify
  [/BigInt.+?catch/, "location.hostname}catch"],
patch("./out/vs/workbench/contrib/webview/browser/pre/service-worker.js", [
  // Webview: bypass requests
  [`addEventListener("fetch",`, "NaN;("],
patch("./out/vs/workbench/api/node/extensionHostProcess.js", [
  // Webview: block resources to avoid long waiting
  [`webviewResourceBaseHost="`, `webviewResourceBaseHost="//`],