httpgd icon indicating copy to clipboard operation
httpgd copied to clipboard

websocket blocked over https

Open yonisidi opened this issue 1 year ago • 2 comments

Describe the bug

I am running R on a VSC remote server and when initiating a plot the external browser is opened, but then no plots are being sent to the new page in the browser. when i look in the js console to see problems i see that the ws is being blocked

To Reproduce

my Rprofile is

if (interactive() && Sys.getenv("TERM_PROGRAM") == "vscode") {
  if (requireNamespace("httpgd", quietly = TRUE)) {
    options(vsc.plot = FALSE)
    options(device = function(...) {
      httpgd::hgd(silent = TRUE)
      .vsc.browser(httpgd::hgd_url(history = FALSE), viewer = "Beside")
    })
  }
}

plot i am creating

> plot(1:10, 1:10)
#VSCode is not running on localhost but on a remote server.
#Opening in external browser...
#Browsing https://apps.workbench.p171649450587.aws-amer.sanofi.com/oneai-rwd-cmei-ibd/cemi-ibd/code-#server/proxy/33755/live?history=FALSE&token=i8pVQ3EH

Expected behavior

plot sent to external browser

Screenshots

image

image

Environment

  • Browser: microsoft edge
r$> sessioninfo::session_info()
─ Session info ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.4.1 (2024-06-14)
 os       Ubuntu 20.04.6 LTS
 system   x86_64, linux-gnu
 ui       X11
 language (EN)
 collate  C
 ctype    C.UTF-8
 tz       Etc/UTC
 date     2024-10-18
 pandoc   2.5 @ /usr/bin/pandoc

─ Packages ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 package     * version date (UTC) lib source
 cli           3.6.3   2024-06-21 [1] CRAN (R 4.4.1)
 httpgd        2.0.2   2024-06-05 [1] CRAN (R 4.4.1)
 jsonlite      1.8.9   2024-09-20 [1] CRAN (R 4.4.1)
 lifecycle     1.0.4   2023-11-07 [1] CRAN (R 4.4.1)
 rlang         1.1.4   2024-06-04 [1] CRAN (R 4.4.1)
 sessioninfo   1.2.2   2021-12-06 [1] CRAN (R 4.4.1)
 systemfonts   1.1.0   2024-05-15 [1] CRAN (R 4.4.1)
 unigd         0.1.2   2024-06-05 [1] CRAN (R 4.4.1)


Additional context

(Write your answer here.)

yonisidi avatar Oct 18 '24 18:10 yonisidi

Same problem while using vscode tunnel to forward the port on remote machine. Even allow the mix content do not show figure but only the framework, and still "Failed to construct "WebSocket"

liuhuoz avatar Dec 12 '24 07:12 liuhuoz

IMHO due to

  • https://github.com/nx10/httpgd/issues/37

benz0li avatar May 09 '25 18:05 benz0li