I've been working on a Shiny app using RSelenium. Locally, everything works, but when I try to host it on shinyapps.io, I encounter an error:
"Connecting to remote server"
Could not open chrome browser.
Client error message:
Undefined error in httr call. httr output: Failed to connect to localhost port 4567 after 0 ms: Connection refused
Check server log for further details.
Warning: Error in checkError: Undefined error in httr call. httr output: length(url) == 1 is not TRUE
15: <Anonymous>
13: fn
8: retry
7: connect$retryingStartServer
6: eval
5: eval
4: eval
3: eval
2: eval.parent
1: local
Shiny Code:
library(shiny)
library(wdman)
library(shiny)
library(RSelenium)
library(httr)
library(pagedown)
library(curl)
library(netstat)
ui <- fluidPage(
actionButton("btn", "Click Me!"),
textOutput("txt"),
)
server <- function(input, output, session) {
observeEvent(input$btn, {
cDrv <- find_chrome()
eCaps <- list(chromeOptions = list(
args = c('--headless', '--disable-gpu', '--window-size=1280,800')
))
client_server <- rsDriver(extraCapabilities = eCaps)
remDr <- client_server$client
remDr$navigate("http://www.google.com")
remDr$maxWindowSize()
title <- remDr$getTitle()
output$txt <- renderText(as.character(title))
remDr$quit()
})
}
shinyApp(ui, server)
What I've Tried:
- Checked dependencies locally, and everything is installed.
- Used the latest version of RSelenium.
- Set up appropriate configurations for the Chrome driver.
I'm open to any suggestions that could help me overcome this issue.