Permalink
Browse files

Allow localhost

  • Loading branch information...
1 parent 92aa797 commit 2012901e598db3f06a163ba512dfd323818935ad Olivier BONNAURE committed Jul 30, 2010
Showing with 30 additions and 8 deletions.
  1. +21 −0 client-io.css
  2. +1 −0 client-io.html
  3. BIN public/forkme_right_white_ffffff.png
  4. +8 −8 server-io.js
View
21 client-io.css
@@ -1,7 +1,28 @@
body {
background: #22252A;
font-family: "monospace", Helvetica, Arial, sans-serif;
+ padding: 0; margin: 0;
}
+
+a img {
+ border: none !important; }
+
+a {
+ font-weight: bold;
+ text-decoration: none;
+ color: white;
+ -webkit-transition-property: opacity, -webkit-transform, color, background-color, padding, -webkit-box-shadow;
+ -webkit-transition-duration: 0.15s;
+ -webkit-transition-timing-function: ease-out; }
+ a:hover { opacity: 0.8; }
+#ribbon {
+ position: fixed;
+ top: 0;
+ right: 0;
+ z-index: 2; }
+
+
+
#room {
position: absolute;
top: 150px;
View
1 client-io.html
@@ -10,6 +10,7 @@
<link rel="stylesheet" type="text/css" href="/client-io.css">
</head>
<body>
+ <a href="http://github.com/solisoft/NMRC"><img id="ribbon" src="public/forkme_right_white_ffffff.png" /></a>
<div class="help">
This is a Multi Rooms Chat Demo using node.js and socket.io
<br / >Usage :
View
BIN public/forkme_right_white_ffffff.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
16 server-io.js
@@ -8,7 +8,7 @@ var http = require("http"),
nicks = {},
rooms = {},
ignore_uniq = false,
- allowed_domains = ["chat.solisoft.net:8090"];
+ allowed_domains = ["chat.solisoft.net:8090", "localhost:8090"];
var send404 = function(res) {
res.writeHead(404);
@@ -68,7 +68,7 @@ var httpServer = http.createServer(function(req, res) {
if(path == "/") path = "/client-io.html";
switch (path) {
default:
- if (/\.(js|html|swf|wav|css)$/.test(path)){
+ if (/\.(js|html|swf|wav|css|png)$/.test(path)){
try {
var ct = "text/html";
@@ -83,7 +83,11 @@ var httpServer = http.createServer(function(req, res) {
if(path.substr(-4) === '.wav') {
ct = "audio/x-wav";
mode = "binary";
- }
+ }
+ if(path.substr(-4) === '.png') {
+ ct = "image/png";
+ mode = "binary";
+ }
res.writeHead(200, {'Content-Type': ct });
res.write(fs.readFileSync(__dirname + path, mode), mode);
res.end();
@@ -178,8 +182,4 @@ socket.on("connection", function(client){
});
client.send(json({ msg: "/hello " + client.sessionId }));
-});
-
-
-
-
+});

0 comments on commit 2012901

Please sign in to comment.