openanalytics / shinyproxy-rstudio-ide-demo

Running RStudio inside ShinyProxy
https://www.shinyproxy.io
16 stars 11 forks source link

Have some difficulties to access to the shiny app launched in rstudio on shinyproxy ? #3

Open mos790 opened 2 years ago

mos790 commented 2 years ago

Hi,

I'm using the latest rstudio version with shinyproxy, basic script and packages installation seems to work. When I start a shiny app with terminal Rscript app.R I get nonfunctional URL

Listening on http://127.0.0.1:5491

I also tried to configure the port and host directly in shiny app

options(shiny.host = '0.0.0.0'); options(shiny.port = 8888)

Have you some advice about for a working configuration ?

Thanks

mnazarov commented 2 years ago

Not really an advice, but a question - why do you start the app from the terminal and not from the console?.. the latter should work fine. And the former would similarly not work (I believe) also in a 'usual' rstudio server... If you could share a bit more about your process and what you are trying to achieve, this might help to find a solution.

mos790 commented 2 years ago

Thanks for the reply. You are right about the fact I can use directly the console for shiny apps.

My problem is about dash apps, I wanted to execute it from terminal ... Seems not to work in the console ...

It seems to be more about the port / host config ?

import dash
import dash_core_components as dcc
import dash_html_components as html

app = dash.Dash()

app.layout = html.Div(children=[
html.Div(children='Hi'),
dcc.Graph(
id='graphss',
figure={
'data': [
{'x':[1,2,3,4,5,6,7], 'y':[11,12,22,23,24,44,55], 'type':'line', 'name':'Energy'},
{'x':[1,2,3,4,5,6,7], 'y':[13,15,26,27,34,44,65], 'type':'bar', 'name':'Time'},
],
'layout': {
'title': 'Graph for Time and Energy'
}
}
)
])

if __name__ == '__main__':
    app.run_server(debug=False)

image

LEDfan commented 2 years ago

Hi

I'm afraid that if RStudio has no native support to host dash apps, this will not work in ShinyProxy currently. We could introduce a feature to also proxy traffic to a different port, therefore I will keep this open as a feature request.

BTW, it seems that jupyter notebooks may have good integration for dash apps see https://github.com/openanalytics/shinyproxy/issues/359 and https://github.com/plotly/jupyter-dash