question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Modify function browser / argument url (options) to allow proxied requests

See original GitHub issue

Is your feature request related to a problem? Please describe.

On code-server it is currently impossible to access HTML help or view Shiny Apps.

This is because the url points to 127.0.0.1 (localhost) instead of the URL at which code-server ist running. Related to Issue #192.

Describe the solution you’d like

At Coder they are working on a HTTP proxy, which will enable port forwarding using path /proxy/<number>.

Is there a way to modify function browser / argument url (options) to use the proxied address instead of 127.0.0.1?

It needs to be clarified how a local (VS Code) installation can be differentiated from a server (code-server) installation.

Describe alternatives you’ve considered

One could check the port used by the httpd help server or Shiny app, open a new browser window and fill in the URL to be proxied.

Additional context

Maybe it is worth looking on how RStudio handles url differently for Shiny Apps on the Desktop and Server version.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
renkun-kencommented, Sep 28, 2021

Thanks for digging into this.

I tried the testing environment and it looks awesome!

The following features work:

  • httpgd plot viewer: plot(rnorm(100))
  • help viewer: ?get
  • htmlwidget viewer: DT::datatable(mtcars)

The following do not work at the moment:

  • data viewer (vscode webview resource uri not correctly substituted?): View(mtcars)
Error: Unable to read file 'vscode-remote://vscode-r.jupyter.b-data.ch/vscode-resource?{"requestResourcePath":"/opt/code-server/extensions/ikuyadeu.r-2.3.0/dist/resources/ag-grid-community.min.noStyle.js"}' (Error: Unable to resolve non-existing file 'vscode-remote://vscode-r.jupyter.b-data.ch/vscode-resource?{"requestResourcePath":"/opt/code-server/extensions/ikuyadeu.r-2.3.0/dist/resources/ag-grid-community.min.noStyle.js"}')
    _ files.ts:1017
    doReadFileStream fileService.ts:541
resourceLoading.ts:82:10
Error: Unable to read file 'vscode-remote://vscode-r.jupyter.b-data.ch/vscode-resource?{"requestResourcePath":"/opt/code-server/extensions/ikuyadeu.r-2.3.0/dist/resources/ag-grid.min.css"}' (Error: Unable to resolve non-existing file 'vscode-remote://vscode-r.jupyter.b-data.ch/vscode-resource?{"requestResourcePath":"/opt/code-server/extensions/ikuyadeu.r-2.3.0/dist/resources/ag-grid.min.css"}')
    _ files.ts:1017
    doReadFileStream fileService.ts:541
resourceLoading.ts:82:10
Error: Unable to read file 'vscode-remote://vscode-r.jupyter.b-data.ch/vscode-resource?{"requestResourcePath":"/opt/code-server/extensions/ikuyadeu.r-2.3.0/dist/resources/ag-theme-balham.min.css"}' (Error: Unable to resolve non-existing file 'vscode-remote://vscode-r.jupyter.b-data.ch/vscode-resource?{"requestResourcePath":"/opt/code-server/extensions/ikuyadeu.r-2.3.0/dist/resources/ag-theme-balham.min.css"}')
    _ files.ts:1017
    doReadFileStream fileService.ts:541
resourceLoading.ts:82:10
Error: Unable to read file 'vscode-remote://vscode-r.jupyter.b-data.ch/vscode-resource?{"requestResourcePath":"/opt/code-server/extensions/ikuyadeu.r-2.3.0/dist/resources/ag-theme-balham-dark.min.css"}' (Error: Unable to resolve non-existing file 'vscode-remote://vscode-r.jupyter.b-data.ch/vscode-resource?{"requestResourcePath":"/opt/code-server/extensions/ikuyadeu.r-2.3.0/dist/resources/ag-theme-balham-dark.min.css"}')
    _ files.ts:1017
    doReadFileStream fileService.ts:541
resourceLoading.ts:82:10
Loading failed for the <script> with source “https://vscode-remote+vscode-002dr-002ejupyter-002eb-002ddata-002ech.vscode-resource.vscode-webview.net/opt/code-server/extensions/ikuyadeu.r-2.3.0/dist/resources/ag-grid-community.min.noStyle.js”. index.html:211:1
Uncaught ReferenceError: agGrid is not defined
    <anonymous> https://vscode-r.jupyter.b-data.ch/user/renkun-ken/code-server/webview/index.html?id=329d9612-2771-457b-8021-b1e95e16086e&swVersion=2&extensionId=Ikuyadeu.r&platform=browser&vscode-resource-base-authority=vscode-resource.vscode-webview.net&parentOrigin=https://vscode-r.jupyter.b-data.ch:278
  • All “View in external browser” still uses internal url for browsing.
0reactions
benz0licommented, Dec 3, 2021

@renkun-ken View(mtcars) works now. Not sure why, though.

Updated this extension from v2.3.0 to v2.3.3. code-server hasn’t been updated in the meantime.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Use a Proxy with Python Requests? - ScrapingBee
In this tutorial we will see how to use a proxy with the Requests package. ... The method will take in two arguments:...
Read more >
Modifying requests in Burp Proxy - PortSwigger
In this tutorial, you'll learn how to modify an intercepted request in Burp Proxy. This enables you to manipulate the request in ways...
Read more >
How to set proxy in Selenium : Tutorial | BrowserStack
Learn to set up an authenticated or non-authenticated proxy in Selenium with a step-by-step tutorial and code samples included.
Read more >
Set up a proxy integration with a proxy resource - Amazon API ...
To set up a proxy integration in an API Gateway API with a proxy resource, you perform the following tasks: Create a proxy...
Read more >
Proxy Auto-Configuration (PAC) file - HTTP - MDN Web Docs
A Proxy Auto-Configuration (PAC) file is a JavaScript function that determines whether web browser requests (HTTP, HTTPS, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found