Blockscout: Some channels at WebSocket are not getting connected when using reverse proxy with modified path

Created on 11 Sep 2018  路  3Comments  路  Source: blockscout/blockscout

We are trying to bring up a reverse proxy that will unite core-alpha.poaexplorer.com and sokol-alpha.poaexplorer.com under the common domain (reverse-proxy.com, for example). The thing we are trying to get is to show core-alpha.poaexplorer.com when user is opening a reverse-proxy.com/poa and
sokol-alpha.poaexplorer.com for reverse-proxy.com/poa/sokol. Also we want to proxy explorers of Ethereum mainnet, kovan networks, etc.
However, we've faced the fact that not all channels at WebSocket are getting connected properly if we are using custom paths at our proxy. We've debugged, that client is not sending channel subscription request. The reason for that might lie in the way how channels are getting connected for the different web pages on poaexplorer website.

Environment

  • Operating System:
    Any

Steps to reproduce

Create a reverse proxy with a custom path. HAProxy frontend example:

frontend default
        bind *:80
        mode http

        acl is_core path_beg /poa
        acl is_sokol path_beg /poa/sokol

        use_backend core if is_core
        use_backend sokol if is_sokol

Expected behaviour

WebSocket channels are getting loaded not based on used path, but, maybe, on classes, that persist on page, or some other conditions

Actual behaviour

Not all Websocket channels are getting loaded. As for now I see 4 channels - transactions, exchange_rate, blocks and addresses, and only exchange_rate is working on all pages.

bug high severity contributor

Most helpful comment

@ArseniiPetrovich We were just talking about this. One of our teams has a fix which should be done in the next day or two. @jimmay5469 Here is the issue that we were just referring to.

All 3 comments

@ArseniiPetrovich We were just talking about this. One of our teams has a fix which should be done in the next day or two. @jimmay5469 Here is the issue that we were just referring to.

@ArseniiPetrovich What is the exact domain that you're using to check for WebSockets? You have to update the check_origin field to match any new WebSocket entry point. https://github.com/poanetwork/blockscout/blob/4a282bf71fdfa7e069daed38efa91e629ef7c422/apps/block_scout_web/config/prod.exs#L20

I update this to //*.poaexplorer.com during my deployment process.

Is exchange_rate the only channel that ever connects, or is it the only one that connects on every page? The other pages selectively connect to only the necessary channels for that page...

Was this page helpful?
0 / 5 - 0 ratings