diff --git a/scripts/communication/template/communication.html b/scripts/communication/template/communication.html
new file mode 100644
index 00000000000..ae47c3f860a
--- /dev/null
+++ b/scripts/communication/template/communication.html
@@ -0,0 +1,576 @@
+
+
+
+ Chat
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/scripts/communication_server.py b/scripts/communication_server.py
index c7c0ff8d9fd..ab9a6386a35 100755
--- a/scripts/communication_server.py
+++ b/scripts/communication_server.py
@@ -26,8 +26,9 @@ The communication server feature of Galaxy can be controlled on three different
"""
-import sys
import argparse
+import os
+import sys
from flask import Flask, request, make_response, current_app
from flask_socketio import SocketIO, emit, disconnect, join_room, leave_room, close_room, rooms
from datetime import timedelta
@@ -81,556 +82,10 @@ def crossdomain(origin=None, methods=None, headers=None,
return update_wrapper(wrapped_function, f)
return decorator
-
-template = """
-
-
- Chat
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-"""
-
+dir = os.path.dirname( __file__ )
+communication_directory = os.path.join( dir, 'communication' )
+template_html_path = os.path.join( communication_directory, 'template/communication.html' )
+template = open(template_html_path, 'r').read()
@app.route('/')
@crossdomain(origin='*')
@@ -648,7 +103,6 @@ def event_broadcast(message):
emit('event response',
{'data': message['data']}, broadcast=True)
-
@socketio.on('event disconnect', namespace='/chat')
def event_disconnect(message):
print("disconnected")