Skip to content

Using WebView in Docker when port is not exposed #192

Closed

Description

@vnijs

I just updated to the latest version of code-server for a docker container that I maintain. The latest version of vscode-R works great ... except that I can't open help files in HTML view. The reason is that webview starts on an (random) port which is not exposed by the docker container. There is some documentation about this but I'm not clear what steps would be needed.

@renkun-ken Wondering if you might have any suggestions on how to deal with something like this. Is it feasible to add an option (e.g., through .Rprofile) for the port to use perhaps?

https://github.com/microsoft/vscode-docs/blob/master/docs/remote/troubleshooting.md#blocked-localhost-ports

options(help_type = "html")

Activity

  1. renkun-ken commented on Jan 18, 2020

    @renkun-ken
    Member

    The following option solves the problem:

    options(help.ports = xxxxx)

    If you need multiple ports to tried sequentially, supply a vector of port numbers, and it will try one by one until one is found avaiable.

    See:

  2. benz0li commented on Feb 19, 2020

    @benz0li
    Contributor

    @vnijs The problem is not with random ports. Webview opens a website that refers to localhost (127.0.0.1), which - from the browser's point of view - doesn't point to the code server (host) but your client on which the browser is running.

    "Allow forwarding ports via URL" is discussed at coder/code-server#1309 - a long overdue request by the [code-server] community.

    To access HTML [help] files, Shiny apps and alike on code-server, some kind of port forwarding proxy and URL rewrite for Webview is needed.

  3. renkun-ken commented on Oct 25, 2021

    @renkun-ken
    Member

    Closed via #803.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions