Kitware / visualizer

The ParaViewWeb Visualizer application which can be used standalone or as a component within another web context.
https://kitware.github.io/visualizer/
BSD 3-Clause "New" or "Revised" License
115 stars 28 forks source link

Visualizer binaryImageStream WebSocket url #11

Closed wxu2016 closed 8 years ago

wxu2016 commented 8 years ago

Hi Sebastien,

In VtkRenderer.js binaryImageStream url is set as const wsbUrl = ${this.props.connection.urls}b;

That works for urls such as ws://127.0.1:/ws, but does not work for urls such as "ws://54.66.238.9/proxy?sessionId=5bd66ccf-2d58-11e6-9052-06fddeae017d".

Is anything need to change in Web/Python/vtk/web/server.py?

Thanks Wei

scottwittenburg commented 8 years ago

The second kind of session url you described is designed to be handled by a webserver like Apache. In that case, you may need to change your Apache rewrite rule to handle it a little differently. The following example shows how I set mine up recently:

# ParaViewWeb websocket proxying
RewriteMap session-to-port txt:/blah/blah/proxy-mapping.txt
RewriteCond %{QUERY_STRING}     ^sessionId=(.*)&path=(.*)$ [NC]
RewriteRule    ^/proxy.*$  ws://${session-to-port:%1}/%2  [P]

Hope this helps.

wxu2016 commented 8 years ago

Hi Scott,

It works. Thanks