Merge pull request #2 from CydarLtd/master
Pull in recent changes from the upstream master onto cydar-master
This commit is contained in:
commit
31b1e2f04a
|
|
@ -26,9 +26,9 @@ var argv = require('optimist').argv,
|
||||||
|
|
||||||
|
|
||||||
// Handle new WebSocket client
|
// Handle new WebSocket client
|
||||||
new_client = function(client) {
|
new_client = function(client, req) {
|
||||||
var clientAddr = client._socket.remoteAddress, log;
|
var clientAddr = client._socket.remoteAddress, log;
|
||||||
console.log(client.upgradeReq.url);
|
console.log(req ? req.url : client.upgradeReq.url);
|
||||||
log = function (msg) {
|
log = function (msg) {
|
||||||
console.log(' ' + clientAddr + ': '+ msg);
|
console.log(' ' + clientAddr + ': '+ msg);
|
||||||
};
|
};
|
||||||
|
|
@ -92,7 +92,7 @@ http_request = function (request, response) {
|
||||||
|
|
||||||
var uri = url.parse(request.url).pathname
|
var uri = url.parse(request.url).pathname
|
||||||
, filename = path.join(argv.web, uri);
|
, filename = path.join(argv.web, uri);
|
||||||
|
|
||||||
fs.exists(filename, function(exists) {
|
fs.exists(filename, function(exists) {
|
||||||
if(!exists) {
|
if(!exists) {
|
||||||
return http_error(response, 404, "404 Not Found");
|
return http_error(response, 404, "404 Not Found");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue