Commit 751495e2 authored by Chris Harris's avatar Chris Harris Committed by Code Review
Browse files

Merge topic 'vtk-web-fixes' into master

0e5cfed7 Add server option to chose host to listen on
734f1d1a Use width and height of container rather than parent
parents 07d399de 0e5cfed7
......@@ -6,6 +6,8 @@ r"""
Any VTK Web executable script come with a set of standard arguments that
can be overriden if need be::
--host localhost
Interface on which the HTTP server will listen on.
--port 8080
Port number on which the HTTP server will listen to.
......
......@@ -18,6 +18,8 @@ r"""
Any VTK Web executable script come with a set of standard arguments that
can be overriden if need be::
--host localhost
Interface on which the HTTP server will listen on.
--port 8080
Port number on which the HTTP server will listen to.
......
......@@ -341,8 +341,8 @@
* @event stop-loading
*/
$(container).parent().trigger("stop-loading");
ctx2d.canvas.width = $(container).parent().innerWidth();
ctx2d.canvas.height = $(container).parent().innerHeight();
ctx2d.canvas.width = $(container).width();
ctx2d.canvas.height = $(container).height();
ctx2d.drawImage(bgImage, 0, 0, bgImage.width, bgImage.height);
renderStatistics();
}
......
......@@ -46,6 +46,8 @@ def add_arguments(parser):
parser.add_argument("-s", "--nosignalhandlers",
help="Prevent Twisted to install the signal handlers so it can be started inside a thread.",
action="store_true")
parser.add_argument("-i", "--host", type=str, default='localhost',
help="the interface for the web-server to listen on (default: localhost)")
parser.add_argument("-p", "--port", type=int, default=8080,
help="port number for the web-server to listen on (default: 8080)")
parser.add_argument("-t", "--timeout", type=int, default=300,
......@@ -89,6 +91,7 @@ def start_webserver(options, protocol=wamp.ServerProtocol, disableLogging=False)
"""
Starts the web-server with the given protocol. Options must be an object
with the following members:
options.host : the interface for the web-server to listen on
options.port : port number for the web-server to listen on
options.timeout : timeout for reaping process on idle in seconds
options.content : root for web-pages to serve.
......@@ -103,7 +106,7 @@ def start_webserver(options, protocol=wamp.ServerProtocol, disableLogging=False)
# setup the server-factory
wampFactory = wamp.ReapingWampServerFactory(
"ws://localhost:%d" % options.port, options.debug, options.timeout)
"ws://%s:%d" % (options.host, options.port), options.debug, options.timeout)
wampFactory.protocol = protocol
# Do we serve static content or just websocket ?
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment