Commit 594a06f0ee2c27f8b4228cb6e86d62feff43c2b0

Authored by ykxie
1 parent 7fa44e84

debug host

server/app.js
@@ -3,7 +3,7 @@ var app = express(); @@ -3,7 +3,7 @@ var app = express();
3 var http = require('http').Server(app); 3 var http = require('http').Server(app);
4 var io = require('socket.io')(http); 4 var io = require('socket.io')(http);
5 var nsp = io.of('/my-namespace'); 5 var nsp = io.of('/my-namespace');
6 -var port = process.env.PORT || 3306; 6 +var port = process.env.PORT || 5000;
7 var path = require('path'); 7 var path = require('path');
8 8
9 var content; 9 var content;
@@ -63,5 +63,5 @@ io.on('connection', function(socket) { @@ -63,5 +63,5 @@ io.on('connection', function(socket) {
63 63
64 64
65 http.listen(port, function() { 65 http.listen(port, function() {
66 - console.log('listening on *:' + port); 66 + console.log('listening on --------:' + port);
67 }); 67 });
src/live/js/student.js
1 $(function() { 1 $(function() {
2 var teacherId = document.getElementById('teacher'); 2 var teacherId = document.getElementById('teacher');
3 var studentId = document.getElementById('student'); 3 var studentId = document.getElementById('student');
4 - var socket = io('http://127.0.0.1:3306'); 4 + var socket = io('http://live-api.com:5000');
5 5
6 var teacher = CodeMirror.fromTextArea(teacherId, { 6 var teacher = CodeMirror.fromTextArea(teacherId, {
7 value: '输入HTML代码', 7 value: '输入HTML代码',
src/live/js/teacher.js
1 $(function(){ 1 $(function(){
2 var teacherId = document.getElementById('teacher'); 2 var teacherId = document.getElementById('teacher');
3 - var socket = io('http://127.0.0.1:3306'); 3 + var socket = io('http://live-api.com:5000');
4 4
5 // 初始化codemirror页面 5 // 初始化codemirror页面
6 var teacher = CodeMirror.fromTextArea(teacherId, { 6 var teacher = CodeMirror.fromTextArea(teacherId, {