Permalink
Browse files

Some logging and integrate socket.io as a submodule

  • Loading branch information...
Malte Ubl Malte Ubl
Malte Ubl authored and Malte Ubl committed Aug 24, 2010
1 parent f72f6b7 commit b53c555cb75510797786431b6ed65430d7309b1a
Showing with 14 additions and 5 deletions.
  1. +3 −0 .gitmodules
  2. +4 −2 lib/server.js
  3. +5 −2 public/client.js
  4. +1 −0 public/ext/socket.io
  5. +1 −1 public/index.html
View
@@ -0,0 +1,3 @@
+[submodule "public/ext/socket.io"]
+ path = public/ext/socket.io
+ url = git://github.com/LearnBoost/Socket.IO.git
View
@@ -17,14 +17,16 @@ var socket = io.listen(server);
var clients = {};
socket.on('connection', function(client){
-
+ console.log("Connection");
var tweety = twitterClient.connect(function (err, data) {
if(err) {
client.send(JSON.stringify(err))
} else {
client.send(data);
}
- })
+ });
+
+ client.send(JSON.stringify("hello world"));
client.on('message', function(msg){
console.log(msg);
View
@@ -2,8 +2,11 @@
var ol = document.createElement("ol");
document.body.appendChild(ol);
- io.setPath('/socket.io/');
- var socket = new io.Socket('localhost', { port: 8888 });
+ io.setPath('/ext/socket.io/');
+ var socket = new io.Socket('localhost', {
+ port: 8888,
+ transports: ['websocket', 'htmlfile', 'xhr-multipart', 'xhr-polling']
+ });
socket.connect();
socket.send('client connect');
socket.on('message', function(data) {
Submodule socket.io added at 9608d4
View
@@ -8,7 +8,7 @@
</style>
</head>
<body>
- <script src=socket-io.js></script>
+ <script src=ext/socket.io/socket.io.js></script>
<script src=client.js></script>
</body>
</html>

0 comments on commit b53c555

Please sign in to comment.