Created
February 23, 2013 22:15
-
-
Save jonnsl/5021596 to your computer and use it in GitHub Desktop.
How to reproduce issue 991 - socket.io
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html5> | |
<html> | |
<head> | |
<title></title> | |
<script src="https://rawgithub.com/LearnBoost/socket.io-client/0.9/dist/socket.io.min.js"></script> | |
<script> | |
var socket = io.connect('http://localhost'); | |
</script> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express') | |
, http = require('http') | |
, path = require('path') | |
, fs = require('fs'); | |
var www = express(); | |
var server = http.createServer(www); | |
require('socket.io').listen(server); | |
var index = fs.readFileSync('index.html').toString(); | |
www.use(function(req, res){ | |
res.send(index); | |
}); | |
// this work | |
//server.listen(3000); | |
// this does not work | |
var app = express(); | |
app.use(express.vhost('localhost', server)); | |
app.listen(3000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment