Get the latest updates from us for free

My journey with websocket - native websocket and node js - Day1




My little curious mind is always involved in game development, I used to develop game in my early days using basic interpreter then later using dbase/foxpro -well dont amaze, yo u can do but not at the higher level, then later on I learned  PHP and I found it suitable for me.

I did some web app development the CMS and etc....but still my passion of developing game is there, for which i started finding options to make games. In between I got the idea of websockets, so here my trouble starts.

After learning so many articles I understood I need VPS to publish my games, development is find I can do in WAMP.

From here my journey started:

I started looking for free VPS option and I got 2 ,1 from host1free.com and later from comfortvps.com which is in my other article ( Free VPS).

In my first VPS I tried some code then done some experiment but not successded , later I understood websocket is blocked from moderator then stopped working there.

In my new VPS as usual I started working on websocket and same issue still persist and it is not working at all. Till here I have learned lot many things about websocket, but I was not getting the real experience.



So far native websocket not worked for me, then I thought lets have look at node.js, it might work as it is JS server itself . Then I started exploring node.js , run some native node.js example and it worked. So I felt happy.

Now the time was to try webscoket and it failed ass usual.... but still I feel to give try then I started digging many articles and 1 had helped me - http://stackoverflow.com/questions/8202053/socket-io-require-is-not-defined but there was another problem with code, which was actually my VPS problem, I have 2 IPS in my VPS , so localhost is pointing to other IP and I was working on other IP(with other website  :D ). So to use this I used IP instead of localhost.

So from here I started running websocket then I realize this could be the problem of my native websocket also and it was exactly same.
I tried with my IP instead localhost and it worked.

Native code :
$server = new Server("localhost", "8000", true);

This could be change like this

$server = new Server("120.100.234.10", "8000", true);

Node.js
<script src="http://localhost:8000/socket.io/socket.io.js">

This could be change like this

<script src="http://xyz.com:8000/socket.io/socket.io.js">

Keep looking here for more updates .

0 comments:

Confused? Feel free to ask

 

Techies

Sponsors

Sponsors

Protection Status

Follow me on Google+

MyFreeCopyright.com Registered & Protected

Advertisements!

Advertisements!

Followers

Copyright © 2012 All Rights Reserved. Any Article on This Blog can not be repost or reproduce in any form without the permission of Author.