Accept server connections from any origin
See original GitHub issueI get errors like the following from my bokeh server application:
bokeh.server.views.ws - ERROR - Refusing websocket connection from Origin 'http://127.0.0.1:8789'; use --allow-websocket-origin=127.0.0.1:8789 to permit this; currently we allow origins {'localhost:8789'}
There may be two problems here:
- (minor) localhost is often synonymous with 127.0.0.1. It might be good to whitelist 127.0.0.1 generally.
- (major) I have started my Bokeh server with the argument
Server(..., host=['*'])
which in previous versions ensured that my server could be accessed regardless of what the caller called my server address.
The second point is more important to me (and to others). It is critical in many applications to be able to robustly view a bokeh server even if we don’t know, at the time of setting up the server, what that server’s address will be. This was the intent of https://github.com/bokeh/bokeh/pull/4052
In [2]: bokeh.__version__
Out[2]: '0.12.5dev15'
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Access-Control-Allow-Origin - HTTP - MDN Web Docs - Mozilla
The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given origin.
Read more >Configuring remote access on a SQL Server instance
This article explains how to configure remote access on a SQL Server instance and connect to a remote SQL Server instance using ApexSQL...
Read more >How to configure source server to accept SSH connections ...
Answer ; Escalate privileges to 'root': · sudo su - # whoami root ; Set password for 'root' user: · passwd ; Restart...
Read more >Configuring CORS - Apollo GraphQL Docs
Cross-Origin Resource Sharing (CORS) is an HTTP-header-based protocol that enables a server to dictate which origins can access its resources.
Read more >How To Allow Remote Access to MySQL - DigitalOcean
Please note, though, that setting bind-address to 0.0.0.0 is insecure as it allows connections to your server from any IP address. On the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@bryevdv and I chatted about this privately. On my side I can add
allow_websocket_origin=["*"]
to my application. Bokeh may dump the oldhosts=
keyword intoallow_websocket_origin=
to facilitate a smoother transition if developer time allows.My fix in Dask is here: https://github.com/dask/distributed/pull/957
After discussion with @mrocklin the problem was discovered. Previously
--host=*
updated the host whitelist, but it also updated theallow_websocket_origin
as a side effect. Now that it is completely ignored, anything that relied on--host=whatever
to allow ws connections too, will have a probelm.So the proposal is this:
Don’t completely ignore
host
. But simply immediately transfer its contents to theallow_websocket_origin
so that old usages will not break. The deprecation message should be updated to reflect that--allow_websocket_origin
may now be explicitly needed.