coder / code-server

VS Code in the browser
https://coder.com
MIT License
67.72k stars 5.56k forks source link

Unable to access VSCode behind inverse proxy #2598

Closed gogasca closed 3 years ago

gogasca commented 3 years ago

Problem description:

When I try to access VSCode behind an inverse Proxy, I get a blank page. If I select "View source" in the blank page, I do see HTML. Not sure if its related to websockets or any other configuration.

[2021-01-19T09:27:24.443Z] info  Using user-data-dir /var/lib/code-server
[2021-01-19T09:27:24.464Z] info  Using config file ~/.config/code-server/config.yaml
[2021-01-19T09:27:24.464Z] info  HTTP server listening on http://0.0.0.0:8081 
[2021-01-19T09:27:24.464Z] info    - Authentication is disabled 
[2021-01-19T09:27:24.464Z] info    - Not serving HTTPS 
[2021-01-19T09:27:48.587Z] debug forking vs code...
[2021-01-19T09:27:49.041Z] debug setting up vs code...
[2021-01-19T09:27:49.043Z] debug vscode got message from code-server {"type":"init"}
[2021-01-19T09:28:17.487Z] debug setting up vs code...
[2021-01-19T09:28:17.489Z] debug vscode got message from code-server {"type":"init"}
[2021-01-19T09:28:18.448Z] debug vscode got message from code-server {"type":"socket"}
[2021-01-19T09:28:18.548Z] debug vscode New connection {"token":"8fc9eda5-401e-4bda-b67b-90c649b132b6"}
[2021-01-19T09:28:18.676Z] warn  vscode Cannot read property '0' of undefined
[2021-01-19T09:28:18.680Z] warn  vscode Cannot read property '0' of undefined

Topology:

My URL is something like this: https://dc49045da149f3f-x.y.z.com

HTTPS -> HTTP Browser <---> HTTPS Proxy <---> [ Proxy Agent Docker <---> VM with Vscode 3.8 ]

Tested: Without Proxy: Browser <---> [ VM with Vscode 3.8 ] Works Without Proxy Agent: Browser <---> Proxy <---> [ VM with Vscode 3.8 ] Fails

Proxy: https://github.com/google/inverting-proxy

In Browser:

INFO [remote-connection][Management   ][8fc9e…][reconnect] starting reconnecting loop. You can get more information with the trace log level.
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] waiting for 5 seconds before reconnecting...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] resolving connection...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] connecting to dc49045da149f3f-x.y.z.com:80...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] reconnected!
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] starting reconnecting loop. You can get more information with the trace log level.
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] waiting for 5 seconds before reconnecting...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] resolving connection...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] connecting to dc49045da149f3f-x.y.z.com:80...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] reconnected!
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] starting reconnecting loop. You can get more information with the trace log level.
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] waiting for 5 seconds before reconnecting...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] resolving connection...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] connecting to dc49045da149f3f-x.y.z.com:80...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] reconnected!
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] starting reconnecting loop. You can get more information with the trace log level.
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] waiting for 5 seconds before reconnecting...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] resolving connection...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] connecting to dc49045da149f3f-x.y.z.com:80...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] reconnected!
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] starting reconnecting loop. You can get more information with the trace log level.
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] waiting for 5 seconds before reconnecting...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] resolving connection...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] connecting to dc49045da149f3f-x.y.z.com:80...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] reconnected!
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] starting reconnecting loop. You can get more information with the trace log level.
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] waiting for 5 seconds before reconnecting...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] resolving connection...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] connecting to dc49045da149f3f-x.y.z.com:80...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] reconnected!
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] starting reconnecting loop. You can get more information with the trace log level.
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] waiting for 5 seconds before reconnecting...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] resolving connection...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] connecting to dc49045da149f3f-x.y.z.com:80...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] reconnected!
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] starting reconnecting loop. You can get more information with the trace log level.
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] waiting for 5 seconds before reconnecting...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] resolving connection...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] connecting to dc49045da149f3f-x.y.z.com:80...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] reconnected!
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] starting reconnecting loop. You can get more information with the trace log level.
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] waiting for 5 seconds before reconnecting...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] resolving connection...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] connecting to dc49045da149f3f-x.y.z.com:80...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] reconnected!
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] starting reconnecting loop. You can get more information with the trace log level.
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] waiting for 5 seconds before reconnecting...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] resolving connection...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] connecting to dc49045da149f3f-x.y.z.com:80...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] reconnected!
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] starting reconnecting loop. You can get more information with the trace log level.
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] waiting for 5 seconds before reconnecting...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] resolving connection...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] connecting to dc49045da149f3f-x.y.z.com:80...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] reconnected!
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] starting reconnecting loop. You can get more information with the trace log level.
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] waiting for 5 seconds before reconnecting...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] resolving connection...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] connecting to dc49045da149f3f-x.y.z.com:80...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] reconnected!
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] starting reconnecting loop. You can get more information with the trace log level.
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] waiting for 5 seconds before reconnecting...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] resolving connection...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] connecting to dc49045da149f3f-x.y.z.com:80...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] reconnected!
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] starting reconnecting loop. You can get more information with the trace log level.
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] waiting for 5 seconds before reconnecting...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] resolving connection...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] connecting to dc49045da149f3f-x.y.z.com:80...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] reconnected!
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] starting reconnecting loop. You can get more information with the trace log level.
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] waiting for 5 seconds before reconnecting...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] resolving connection...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] connecting to dc49045da149f3f-x.y.z.com:80...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] reconnected!
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] starting reconnecting loop. You can get more information with the trace log level.
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] waiting for 5 seconds before reconnecting...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] resolving connection...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] connecting to dc49045da149f3f-x.y.z.com:80...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] reconnected!
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] starting reconnecting loop. You can get more information with the trace log level.
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] waiting for 5 seconds before reconnecting...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] resolving connection...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] connecting to dc49045da149f3f-x.y.z.com:80...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] reconnected!
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] starting reconnecting loop. You can get more information with the trace log level.
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] waiting for 5 seconds before reconnecting...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] resolving connection...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] connecting to dc49045da149f3f-x.y.z.com:80...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] reconnected!
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] starting reconnecting loop. You can get more information with the trace log level.
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] waiting for 5 seconds before reconnecting...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] resolving connection...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] connecting to dc49045da149f3f-x.y.z.com:80...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] reconnected!
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] starting reconnecting loop. You can get more information with the trace log level.
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] waiting for 5 seconds before reconnecting...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] resolving connection...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] connecting to dc49045da149f3f-x.y.z.com:80...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] reconnected!
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] starting reconnecting loop. You can get more information with the trace log level.
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] waiting for 5 seconds before reconnecting...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] resolving connection...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] connecting to dc49045da149f3f-x.y.z.com:80...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] reconnected!
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] starting reconnecting loop. You can get more information with the trace log level.
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] waiting for 5 seconds before reconnecting...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] resolving connection...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] connecting to dc49045da149f3f-x.y.z.com:80...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] reconnected!
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] starting reconnecting loop. You can get more information with the trace log level.
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] waiting for 5 seconds before reconnecting...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] resolving connection...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] connecting to dc49045da149f3f-x.y.z.com:80...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] reconnected!
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] starting reconnecting loop. You can get more information with the trace log level.
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] waiting for 5 seconds before reconnecting...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] resolving connection...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] connecting to dc49045da149f3f-x.y.z.com:80...
log.ts:185  INFO [remote-connection][Management   ][8fc9e…][reconnect] reconnected!

Should I configure an extra setting in VSCode with my external URL ? Any pointers are appreciated.

In View Source:

<!-- Copyright (C) Microsoft Corporation. All rights reserved. -->
<!DOCTYPE html>
<html>
  <head>
    <script>
      globalThis.MonacoPerformanceMarks = globalThis.MonacoPerformanceMarks || []
      globalThis.MonacoPerformanceMarks.push("renderer/started", Date.now())
    </script>

    <meta charset="utf-8" />

    <!-- Disable pinch zooming -->
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no"
    />

    <!-- Workbench Configuration -->
    <meta id="vscode-workbench-web-configuration" data-settings='{"remoteAuthority":"dc49045da149f3f-x.y.z.com","logLevel":1,"workspaceProvider":{"payload":[["userDataPath","/var/lib/code-server"],["enableProposedApi","[]"]]},"homeIndicator":{"href":"https://github.com/cdr/code-server","icon":"code","title":"Home"}}' />

    <!-- Workarounds/Hacks (remote user data uri) -->
    <meta id="vscode-remote-user-data-uri" data-settings='{"$mid":1,"path":"/var/lib/code-server","scheme":"vscode-remote","authority":"dc49045da149f3f-x.y.z.com"}' />
    <meta id="vscode-remote-product-configuration" data-settings='{"nameShort":"code-server","nameLong":"code-server","applicationName":"code-oss","dataFolderName":".vscode-oss","win32MutexName":"vscodeoss","licenseName":"MIT","licenseUrl":"https://github.com/microsoft/vscode/blob/master/LICENSE.txt","win32DirName":"Microsoft Code OSS","win32NameVersion":"Microsoft Code OSS","win32RegValueName":"CodeOSS","win32AppId":"{{E34003BB-9E10-4501-8C11-BE3FAA83F23F}","win32x64AppId":"{{D77B7E06-80BA-4137-BCF4-654B95CCEBC5}","win32arm64AppId":"{{D1ACE434-89C5-48D1-88D3-E2991DF85475}","win32UserAppId":"{{C6065F05-9603-4FC4-8101-B9781A25D88E}","win32x64UserAppId":"{{CC6B787D-37A0-49E8-AE24-8559A032BE0C}","win32arm64UserAppId":"{{3AEBF0C8-F733-4AD4-BADE-FDB816D53D7B}","win32AppUserModelId":"Microsoft.CodeOSS","win32ShellNameShort":"C&ode - OSS","darwinBundleIdentifier":"com.visualstudio.code.oss","linuxIconName":"com.visualstudio.code.oss","licenseFileName":"LICENSE.txt","reportIssueUrl":"https://github.com/cdr/code-server/issues/new","urlProtocol":"code-oss","extensionAllowedProposedApi":["ms-vscode.vscode-js-profile-flame","ms-vscode.vscode-js-profile-table","ms-vscode.references-view","ms-vscode.github-browser"],"builtInExtensions":[{"name":"ms-vscode.node-debug","version":"1.44.14","repo":"https://github.com/microsoft/vscode-node-debug","metadata":{"id":"b6ded8fb-a0a0-4c1c-acbd-ab2a3bc995a6","publisherId":{"publisherId":"5f5636e7-69ed-4afe-b5d6-8d231fb3d3ee","publisherName":"ms-vscode","displayName":"Microsoft","flags":"verified"},"publisherDisplayName":"Microsoft"}},{"name":"ms-vscode.node-debug2","version":"1.42.5","repo":"https://github.com/microsoft/vscode-node-debug2","metadata":{"id":"36d19e17-7569-4841-a001-947eb18602b2","publisherId":{"publisherId":"5f5636e7-69ed-4afe-b5d6-8d231fb3d3ee","publisherName":"ms-vscode","displayName":"Microsoft","flags":"verified"},"publisherDisplayName":"Microsoft"}},{"name":"ms-vscode.references-view","version":"0.0.71","repo":"https://github.com/microsoft/vscode-reference-view","metadata":{"id":"dc489f46-520d-4556-ae85-1f9eab3c412d","publisherId":{"publisherId":"5f5636e7-69ed-4afe-b5d6-8d231fb3d3ee","publisherName":"ms-vscode","displayName":"Microsoft","flags":"verified"},"publisherDisplayName":"Microsoft"}},{"name":"ms-vscode.js-debug-companion","version":"1.0.8","repo":"https://github.com/microsoft/vscode-js-debug-companion","metadata":{"id":"99cb0b7f-7354-4278-b8da-6cc79972169d","publisherId":{"publisherId":"5f5636e7-69ed-4afe-b5d6-8d231fb3d3ee","publisherName":"ms-vscode","displayName":"Microsoft","flags":"verified"},"publisherDisplayName":"Microsoft"}},{"name":"ms-vscode.js-debug","version":"1.51.0","repo":"https://github.com/microsoft/vscode-js-debug","metadata":{"id":"25629058-ddac-4e17-abba-74678e126c5d","publisherId":{"publisherId":"5f5636e7-69ed-4afe-b5d6-8d231fb3d3ee","publisherName":"ms-vscode","displayName":"Microsoft","flags":"verified"},"publisherDisplayName":"Microsoft"}},{"name":"ms-vscode.vscode-js-profile-table","version":"0.0.11","repo":"https://github.com/microsoft/vscode-js-debug","metadata":{"id":"7e52b41b-71ad-457b-ab7e-0620f1fc4feb","publisherId":{"publisherId":"5f5636e7-69ed-4afe-b5d6-8d231fb3d3ee","publisherName":"ms-vscode","displayName":"Microsoft","flags":"verified"},"publisherDisplayName":"Microsoft"}}],"webBuiltInExtensions":[{"name":"ms-vscode.github-browser","version":"0.0.13","repo":"https://github.com/microsoft/vscode-github-browser","metadata":{"id":"c1bcff4b-4ecb-466e-b8f6-b02788b5fb5a","publisherId":{"publisherId":"5f5636e7-69ed-4afe-b5d6-8d231fb3d3ee","publisherName":"ms-vscode","displayName":"Microsoft","flags":"verified"},"publisherDisplayName":"Microsoft"}}],"//":"https://github.com/VSCodium/vscodium/pull/155/files","documentationUrl":"https://go.microsoft.com/fwlink/?LinkID=533484#vscode","keyboardShortcutsUrlMac":"https://go.microsoft.com/fwlink/?linkid=832143","keyboardShortcutsUrlLinux":"https://go.microsoft.com/fwlink/?linkid=832144","keyboardShortcutsUrlWin":"https://go.microsoft.com/fwlink/?linkid=832145","introductoryVideosUrl":"https://go.microsoft.com/fwlink/?linkid=832146","tipsAndTricksUrl":"https://go.microsoft.com/fwlink/?linkid=852118","newsletterSignupUrl":"https://www.research.net/r/vsc-newsletter","commit":"c4610f7829701aadb045d450013b84491c30580d","date":"2020-12-18T20:25:37Z","version":"1.51.1","extensionsGallery":{"serviceUrl":"https://extensions.coder.com/api","itemUrl":"","controlUrl":"","recommendationsUrl":""},"codeServerVersion":"3.8.0"}' />
    <meta id="vscode-remote-nls-configuration" data-settings='{"locale":"en","availableLanguages":{}}' />

    <!-- Workbench Icon/Manifest/CSS -->
    <link rel="icon" href="./static/c4610f7829701aadb045d450013b84491c30580d/usr/lib/code-server/src/browser/media/favicon.svg" />
    <link rel="alternate icon" href="./static/c4610f7829701aadb045d450013b84491c30580d/usr/lib/code-server/src/browser/media/favicon.ico" />
    <link rel="manifest" href="./static/c4610f7829701aadb045d450013b84491c30580d/usr/lib/code-server/src/browser/media/manifest.json" crossorigin="use-credentials" />

    <link data-name="vs/workbench/workbench.web.api" rel="stylesheet" href="./static/c4610f7829701aadb045d450013b84491c30580d/usr/lib/code-server/lib/vscode/out/vs/workbench/workbench.web.api.css">

    <link rel="apple-touch-icon" sizes="192x192" href="./static/c4610f7829701aadb045d450013b84491c30580d/usr/lib/code-server/src/browser/media/pwa-icon-192.png" />
    <link rel="apple-touch-icon" sizes="512x512" href="./static/c4610f7829701aadb045d450013b84491c30580d/usr/lib/code-server/src/browser/media/pwa-icon-512.png" />
    <meta name="apple-mobile-web-app-capable" content="yes" />

    <meta id="coder-options" data-settings='{"base":".","csStaticBase":"./static/c4610f7829701aadb045d450013b84491c30580d/usr/lib/code-server","logLevel":1,"disableTelemetry":false,"disableUpdateCheck":false}' />
  </head>

  <body aria-label=""></body>

  <!-- Startup (do not modify order of script tags!) -->
  <script data-cfasync="false" src="./static/c4610f7829701aadb045d450013b84491c30580d/usr/lib/code-server/dist/pages/vscode.js"></script>
  <script data-cfasync="false" src="./static/c4610f7829701aadb045d450013b84491c30580d/usr/lib/code-server/dist/register.js"></script>
  <script data-cfasync="false" src="./static/c4610f7829701aadb045d450013b84491c30580d/usr/lib/code-server/lib/vscode/out/vs/loader.js"></script>
  <script>
    globalThis.MonacoPerformanceMarks.push("willLoadWorkbenchMain", Date.now())
  </script>

  <script data-cfasync="false" src="./static/c4610f7829701aadb045d450013b84491c30580d/usr/lib/code-server/lib/vscode/out/vs/workbench/workbench.web.api.nls.js"></script>
  <script data-cfasync="false" src="./static/c4610f7829701aadb045d450013b84491c30580d/usr/lib/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js"></script>

  <script>
    require(["vs/code/browser/workbench/workbench"], function () {})
  </script>
</html>
code-asher commented 3 years ago

If you can I'd recommend using code-server --link. That uses our own "inverting proxy" and handles everything for you.

As for the issue here, it does look like it's having trouble with websockets. Are you using App Engine? The proxy readme says there are extra steps to get websockets working there: https://github.com/google/inverting-proxy#limitations

gogasca commented 3 years ago

Thanks for replying, I'm using a Google internal version of the inverting Proxy. This version provides a shim.

I was curious if the Code Server is expecting some specific headers or require additional configuration if its behind a Proxy: For example remoteAuthority and authority fields.

<!-- Workbench Configuration -->
    <meta id="vscode-workbench-web-configuration" data-settings='{"remoteAuthority":"dc49045da149f3f-x.y.z.com","logLevel":1,"workspaceProvider":{"payload":[["userDataPath","/var/lib/code-server"],["enableProposedApi","[]"]]},"homeIndicator":{"href":"https://github.com/cdr/code-server","icon":"code","title":"Home"}}' />

or

<meta id="vscode-remote-user-data-uri" data-settings='{"$mid":1,"path":"/var/lib/code-server","scheme":"vscode-remote","authority":"dc49045da149f3f-x.y.z.com"}' />