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.

Accept server connections from any origin

See original GitHub issue

I 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:

  1. (minor) localhost is often synonymous with 127.0.0.1. It might be good to whitelist 127.0.0.1 generally.
  2. (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:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

4reactions
mrocklincommented, Mar 20, 2017

@bryevdv and I chatted about this privately. On my side I can add allow_websocket_origin=["*"] to my application. Bokeh may dump the old hosts= keyword into allow_websocket_origin= to facilitate a smoother transition if developer time allows.

My fix in Dask is here: https://github.com/dask/distributed/pull/957

1reaction
bryevdvcommented, Mar 20, 2017

After discussion with @mrocklin the problem was discovered. Previously --host=* updated the host whitelist, but it also updated the allow_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 the allow_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.

Read more comments on GitHub >

github_iconTop 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 >

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