simple chat : helloworld.html on client side and not on server side.

60 views
Skip to first unread message

yarek chmielewski

unread,
Jul 25, 2012, 1:41:15 PM7/25/12
to no...@googlegroups.com
Hello
I got running the simple chat sample on my server.
Great !
My problem is : the client part (the HTML page) is infact on the server (the helloworld.html).

Is is possible to run it locally ? like file:/// and not be hosted on server !

regards

Nate Morse

unread,
Jul 25, 2012, 2:41:56 PM7/25/12
to no...@googlegroups.com
I think that you will run into a browser security violation.  To have a file:/// system serve a page, and then try to access other server(s) via ajax/sockets. The idea is... it protects you from downloading HTML and clicking on it and running some untrusted code that goes out to the internet.
I think that you may have to set up a node.js server on you local machine... 

yarek chmielewski

unread,
Jul 25, 2012, 6:22:42 PM7/25/12
to no...@googlegroups.com
ok, forget about file://
what about http:// access ?

My idea is to run this chat sample on normal 80 port and not using a special port.
Is that possible ?


 

Jay Are Galinada

unread,
Jul 26, 2012, 4:47:33 AM7/26/12
to no...@googlegroups.com


Noong Huwebes, Hulyo 26 2012 06:22:42 UTC+8, si yarek chmielewski ay sumulat:
Yes, it is possible to run the your nodejs server in port 80
as long as no other programs/services using that port, and incoming and outgoing 80 port is open to your system.

khinester

unread,
Aug 9, 2012, 3:41:19 PM8/9/12
to no...@googlegroups.com


On Thursday, July 26, 2012 9:47:33 AM UTC+1, Jay Are Galinada wrote:


Noong Huwebes, Hulyo 26 2012 06:22:42 UTC+8, si yarek chmielewski ay sumulat:
ok, forget about file://
what about http:// access ?

My idea is to run this chat sample on normal 80 port and not using a special port.
Is that possible ?

Or you can put it behind nginx like:

server {
        server_name  now.local;
        # All R-ead URI's point to 19080 instance
        location / {
            proxy_pass http://127.0.0.1:19080;
            proxy_set_header        Host            $host;
            proxy_set_header        X-Real-IP       $remote_addr;
            proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        }
        # Adding the nodejs proxy
        location ~* "(/stat/1.gif|/now|/config.json)" {
            proxy_pass http://127.0.0.1:29080;
            proxy_set_header        Host            $host;
            proxy_set_header        X-Real-IP       $remote_addr;
            proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for; 
        } 

So in the above case, anything pointing to /stat/1.gif|/now|/config.json is proxied to http://127.0.0.1:29080
And anything else is proxied to a different application, in my case ikaaro running on 19080.
Reply all
Reply to author
Forward
0 new messages