Skip to content

Commit 429674c

Browse files
committed
started integrating TogetherJS hub server into the admin hub
1 parent 39074fb commit 429674c

4 files changed

Lines changed: 639 additions & 2 deletions

File tree

‎v3/js/opt-frontend.js‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ var TogetherJSConfig_cloneClicks = '#pyInputPane select,#pyInputPane #executeBtn
5959
var TogetherJSConfig_siteName = "Online Python Tutor live help";
6060
var TogetherJSConfig_toolName = "Online Python Tutor live help";
6161

62+
//var TogetherJSConfig_hubBase = "http://184.173.101.176:30035/"; // online
63+
var TogetherJSConfig_hubBase = "http://localhost:30035/"; // local
64+
6265
var isTutor = false;
6366

6467
// TODO: consider deferred initialization later: "TogetherJS starts up
@@ -190,7 +193,7 @@ function initTogetherJS() {
190193

191194

192195
try {
193-
var source = new EventSource('http://togetherjs.pythontutor.com/learner-SSE');
196+
var source = new EventSource(TogetherJSConfig_hubBase + 'learner-SSE');
194197
source.onmessage = function(e) {
195198
var dat = JSON.parse(e.data);
196199

@@ -244,7 +247,7 @@ function initTogetherJS() {
244247
}
245248
else {
246249
// if you're a learner, request help when TogetherJS is activated
247-
$.get("http://togetherjs.pythontutor.com/request-help",
250+
$.get(TogetherJSConfig_hubBase + 'request-help',
248251
{url: TogetherJS.shareUrl()},
249252
null /* don't use a callback; rely on SSE */);
250253
}

‎v3/opt_togetherjs/README.txt‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
server.js is forked from TogetherJS togetherjs/hub/server.js and
2+
augmented with extra logging and an admin interface
3+
4+
To run both locally and online, use:
5+
6+
node server.js --host 0.0.0.0 --port 30035

‎v3/opt_togetherjs/hub.js‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
// created on 2014-04-29 by Philip Guo
22

3+
// DEPRECATED on 2014-05-08. Use server.js instead to implement both the
4+
// administrator hub and the TogetherJS server all in one program.
5+
36
// To install on Webfaction, run:
47
// npm install express
58
// npm install node-uuid

0 commit comments

Comments
 (0)