Hello, I've found a script of a game (javascript) that is connected with a socket webserver.

Now I was thinking if it is possible to play this game on my local host?

Index.html
Code:
<html>
<body>
<header>Header</header>
<center>
<nav>navigation</nav>
<canvas id="canvas" style="background: black;" width="605px" height="420px">Your browser needs to support canvas for this to work!</canvas>
<script src="http://localhost:8080/socket.io/socket.io.js"></script>
<script src="/game17.js"></script>
</body>
</html>
game17.js
Code:
var url = 'http://localhost:8080';var socket = io.connect();var board=[];var canvas,ctx,mouse_x=0,mouse_y=0,board_x=0,board_y=0,fps=30;function init()


socket = io.listen(8080);{var a=document.getElementById("canvas");ctx=a.getContext("2d");ctx.canvas.width=605;ctx.canvas.height=420;background=new Image();background.src="images/background.png";high_bg=new Image();high_bg.src="images/high_bg.png";start_screen=new Image();start_screen.src="images/start_screen3.png";player_sprites_img=new Image();player_sprites_img.src="images/bomber_green3.png";speed_img=new Image();speed_img.src="images/speed_img.png";power_img=new Image();power_img.src="images/power_img.png";shield_img=new Image();shield_img.src="images/shield_img.png";bombb_img=new Image();bombb_img.src="images/bomb_img.png";speed2_img=new Image();speed2_img.src="images/speed2_img.png";power2_img=new Image();power2_img.src="images/power2_img.png";shield2_img=new Image();shield2_img.src="images/shield2_img.png";bombb2_img=new Image();bombb2_img.src="images/bomb2_img.png";block_img=new Image();block_img.src="images/block.png";brick_img=new Image();brick_img.src="images/brick.png";brick2_img=new Image();brick2_img.src="images/brick2.png";brick3_img=new Image();brick3_img.src="images/brick3.png";brick4_img=new Image();brick4_img.src="images/brick4.png";brick5_img=new Image();brick5_img.src="images/brick5.png";brick6_img=new Image();brick6_img.src="images/brick6.png";bomb_img=new Image();bomb_img.src="images/bomb.png";bomb2_img=new Image();bomb2_img.src="images/bomb2.png";boom_center=new Image();boom_center.src="images/boom_center.png";boom_left=new Image();boom_left.src="images/boom_left.png";boom_up=new Image();boom_up.src="images/boom_up.png";boom_right=new Image();boom_right.src="images/boom_right.png";boom_down=new Image();boom_down.src="images/boom_down.png";boom2=new Image();boom2.src="images/boom2.png";setInterval(loop,1000/fps)}init();var full=true,player_num=undefined,player_colors=["lime","red","yellow","blue","cyan","orange","pink","black"],players=[false,false,false,false,false,false,false,false],players_modified=[false,false,false,false,false,false,false,false],keys=[[37,false,[-1,0,-1,-1,-1,1],0],[38,false,[0,-1,-1,-1,1,-1],0],[39,false,[1,0,1,-1,1,1],0],[40,false,[0,1,-1,1,1,1],0],[32,false]],cur_dir=[],start_dir=[],f=40,g=240,actions=[false,false],board_x=0,board_y=0;window.onkeydown=keydown;window.onkeyup=keyup;window.onkeypress=keypress;var nickname="";function keypress(c){if(login==false&&nickname.length<10){c=c||window.event;var a=c.charCode||c.keyCode,b=String.fromCharCode(a);nickname=nickname+b}else{if(login==true&&players[player_num][17][2]==true){c=c||window.event;var a=c.charCode||c.keyCode,b=String.fromCharCode(a);if(players[player_num][17][3]==true&&c.keyCode!=13){players[player_num][17][0]=b;players[player_num][17][3]=false}else{if(players[player_num][17][0].length<=30){players[player_num][17][0]=players[player_num][17][0]+b}}}}return false}function keydown(c){if(login==false){if(c.keyCode==8){nickname=nickname.slice(0,-1);return false}if(c.keyCode==13){socket.emit("13",nickname)}}else{if(login==true){if(c.keyCode==8&&players[player_num][17][2]==true){players[player_num][17][0]=players[player_num][17][0].slice(0,-1);return false}if(c.keyCode==13){if(players[player_num][17][2]==false){players[player_num][17][1]="red";players[player_num][17][2]=true;players[player_num][17][3]=true}else{socket.emit("7",players[player_num][17][0])}}if(c.keyCode==32&&players[player_num][13]==false&&players[player_num][17][2]==false&&players[player_num][6]==true){players[player_num][13]=true;socket.emit("9",1)}else{if(c.keyCode==32&&players[player_num][13]==false&&players[player_num][17][2]==false&&players[player_num][6]==false){socket.emit("11")}else{if(c.keyCode==37&&players[player_num][10][3]!=37){players[player_num][10][3]=37;socket.emit("12",c.keyCode)}else{if(c.keyCode==38&&players[player_num][10][3]!=38){players[player_num][10][3]=38;socket.emit("12",c.keyCode)}else{if(c.keyCode==39&&players[player_num][10][3]!=39){players[player_num][10][3]=39;socket.emit("12",c.keyCode)}else{if(c.keyCode==40&&players[player_num][10][3]!=40){players[player_num][10][3]=40;socket.emit("12",c.keyCode)}}}}}}if(c.keyCode==37||c.keyCode==38||c.keyCode==39||c.keyCode==40){return false}if(c.keycode==32){if(login==true&&players[player_num][17][2]==true&&players[player_num][17][0].length<=30){c=c||window.event;var a=c.charCode||c.keyCode,b=String.fromCharCode(a);players[player_num][17][0]=players[player_num][17][0]+b;return false}}}}}function keyup(a){if(a.keyCode==32){players[player_num][13]=false;socket.emit("9",0)}else{if(a.keyCode==37){socket.emit("3")}else{if(a.keyCode==38){socket.emit("3")}else{if(a.keyCode==39){socket.emit("3")}else{if(a.keyCode==40){socket.emit("3")}}}}}return false}function clearCanvas(){ctx.clearRect(0,0,600,420)}var z=0;var login=false;var message=["Press enter to type...","white",false];var t=0;var x=0;function draw_player(b){if(players[b]!=false){if(players[b][6]==true){if(players[b][10][0]!=false){var a=false;if(players[b][18]>0){var e=players[b][18]-Math.floor(players[b][18]/14)*14;if(e<=5){a=false}else{a=true}}else{players[b][18]=15}}if(players[b][10][0]==37){if(a==true){players[b][20]=156}else{players[b][20]=182}players[b][18]--}else{if(players[b][10][0]==38){if(a==true){players[b][20]=260}else{players[b][20]=286}players[b][18]--}else{if(players[b][10][0]==39){if(a==true){players[b][20]=104}else{players[b][20]=130}players[b][18]--}else{if(players[b][10][0]==40){if(a==true){players[b][20]=26}else{players[b][20]=52}players[b][18]--}}}}if(players[b][11]>0){if(flicker(players[b][11])==true){}else{ctx.drawImage(player_sprites_img,players[b][20],b*26,26,26,Math.round(players[b][0]),Math.round(players[b][1]),26,26);ctx.fillStyle=player_colors[b];ctx.font="10px verdana";var d=ctx.measureText(players[b][15].substring(0,3));var c=d.width;ctx.fillText(players[b][15].substring(0,3),Math.round(players[b][0])+26/2-Math.round(c/2),Math.round(players[b][1]))}players[b][11]--}else{if(players[b][6]==true){ctx.fillStyle=player_colors[b];ctx.font="10px verdana";var d=ctx.measureText(players[b][15].substring(0,3));var c=d.width;ctx.fillText(players[b][15].substring(0,3),Math.round(players[b][0])+26/2-Math.round(c/2),Math.round(players[b][1]));ctx.drawImage(player_sprites_img,players[b][20],b*26,26,26,Math.round(players[b][0]+2),Math.round(players[b][1]+2),26,26);t++}}}else{if(players[b][6]>10){ctx.fillStyle=player_colors[b];ctx.font="10px verdana";var d=ctx.measureText(players[b][15].substring(0,3));var c=d.width;ctx.fillText(players[b][15].substring(0,3),Math.round(players[b][0])+26/2-Math.round(c/2),Math.round(players[b][1]));if(players[b][6]>70){ctx.drawImage(player_sprites_img,312,b*26,26,26,Math.round(players[b][0]+2),Math.round(players[b][1]+2),26,26)}else{if(players[b][6]>50){ctx.drawImage(player_sprites_img,338,b*26,26,26,Math.round(players[b][0]+2),Math.round(players[b][1]+2),26,26)}else{if(players[b][6]>30){if(flicker(players[b][6])){ctx.drawImage(player_sprites_img,364,b*26,26,26,Math.round(players[b][0]+2),Math.round(players[b][1]+2),26,26)}}else{if(players[b][6]>10){if(flicker(players[b][6])){ctx.drawImage(player_sprites_img,390,b*26,26,26,Math.round(players[b][0]+2),Math.round(players[b][1]+2),26,26)}}}}}players[b][6]--}else{players[b][6]=false}}}}var lolz=0,bombz=0,shieldz=0;function draw(){if(login==true){ctx.drawImage(background,0,0,600,420);for(var b=0;b<board.length;b++){for(var a=0;a<board[b].length;a++){if(board[b][a][4]==1){ctx.drawImage(brick_img,board_x+b*28,board_y+a*28,45,45)}else{if(board[b][a][4]==2){ctx.drawImage(block_img,board_x+b*28,board_y+a*28,45,45)}else{if(board[b][a][0]==3){if(bombz%2==0){ctx.drawImage(bomb2_img,board_x+b*28,board_y+a*28,28,28)}else{ctx.drawImage(bomb_img,board_x+b*28,board_y+a*28,28,28)}}else{if(board[b][a][0]==4&&board[b][a][10]!=1){ctx.drawImage(boom2,board_x+b*28,board_y+a*28,28,28)}else{if(board[b][a][0]==5||board[b][a][0]==4&&board[b][a][10]==1){ctx.drawImage(boom_center,board_x+b*28,board_y+a*28,28,28)}else{if(board[b][a][0]==9){if(flicker2(lolz)==true){ctx.drawImage(bombb2_img,board_x+b*28,board_y+a*28,28,28)}else{ctx.drawImage(bombb_img,board_x+b*28,board_y+a*28,28,28)}}else{if(board[b][a][0]==6){if(flicker2(lolz)==true){ctx.drawImage(power_img,board_x+b*28,board_y+a*28,28,28)}else{ctx.drawImage(power2_img,board_x+b*28,board_y+a*28,28,28)}}else{if(board[b][a][0]==7){if(flicker2(lolz)==true){ctx.drawImage(speed_img,board_x+b*28,board_y+a*28,28,28)}else{ctx.drawImage(speed2_img,board_x+b*28,board_y+a*28,28,28)}}else{if(board[b][a][0]==8){if(board[b][a][1]>=60){if(flicker2(lolz)==true){ctx.drawImage(shield_img,board_x+b*28,board_y+a*28,28,28)}else{ctx.drawImage(shield2_img,board_x+b*28,board_y+a*28,28,28)}}else{if(flicker(shieldz)==true){if(flicker2(lolz)==true){ctx.drawImage(shield_img,board_x+b*28,board_y+a*28,28,28)}else{ctx.drawImage(shield2_img,board_x+b*28,board_y+a*28,28,28)}}else{}}board[b][a][1]--}}}}}}}}}lolz=lolz+0.002;if(lolz>1000){lolz=0}bombz++;if(bombz>1000){bombz=0}shieldz=shieldz+2;if(shieldz>1000){shieldz=0}}}ctx.drawImage(high_bg,420,0,185,420);for(var b=0;b<players.length;b++){if(players[b]!=false){draw_player(b)}}for(var b=0;b<players_modified.length;b++){if(players_modified[b]!=false){ctx.drawImage(player_sprites_img,0,players_modified[b][5]*26,26,26,430,22+40*b,26,26);ctx.fillStyle="white";ctx.font="15px verdana";ctx.fillText(players_modified[b][15],465,35+40*b);ctx.font="10px verdana";if(players_modified[b][16]<0){ctx.fillStyle="red"}ctx.fillText("SCORE : "+players_modified[b][16],465,46+40*b);ctx.fillStyle="white";ctx.fillStyle=players_modified[b][17][1];ctx.font="10px verdana";ctx.fillText(players_modified[b][17][0],465,56+40*b)}}}else{if(login==false){ctx.drawImage(start_screen,0,0,600,420);ctx.fillStyle="black";ctx.font="15px verdana";ctx.fillStyle="black";ctx.fillText(nickname,165,105)}}}function onBoard(a,b){return a>=0&&b>=0&&a<=14&&b<=14}function flicker(b){if(b>0){var a=b-Math.floor(b/9)*9;if(a<=3){return false}else{return true}}}function flicker2(b){if(b>0){var a=b-Math.floor(b/2)*2;if(a<=1){return false}else{return true}}}var directions=[-1,0,0,-1,1,0,0,1];var items=[];function update(a){for(var n=0;n<players.length;n++){if(players[n]!=false&&players[n][10]!=0&&players[n][10][2]!=false&&players[n][10]!=1){players[n][0]=players[n][0]+(players[n][10][2][0])*(players[n][9]*28*(a/(1000/30))/22);players[n][1]=players[n][1]+(players[n][10][2][1])*(players[n][9]*28*(a/(1000/30))/22)}}for(var m=0;m<board.length;m++){for(var h=0;h<board[m].length;h++){if(board[m][h][0]==3){if(board[m][h][1]>0){board[m][h][1]--}else{board[m][h]=[4,5,board[m][h][2],1,50,false,1,board[m][h][3]]}}if(board[m][h][0]==5&&board[m][h][6]==1){board[m][h]=board[m][h].splice(7,20);board[m][h][7]=board[m][h][9];board[m][h][9]=undefined;board[m][h][1]=1}if(board[m][h][0]==4&&board[m][h][1]<=0&&board[m][h][3]==1){board[m][h]=[4,5,board[m][h][2],0,50,false,0,board[m][h][7],0,board[m][h][9],1];var e=0;while(e<directions.length){var c=1;while(c<board[m][h][2]){if(onBoard((m+c*directions[e]),(h+c*directions[e+1]))){if(board[m+c*directions[e]][h+c*directions[e+1]][0]==3){if(board[m][h][7]==board[m+c*directions[e]][h+c*directions[e+1]][3]){board[m+c*directions[e]][h+c*directions[e+1]]=[4,5+c,board[m+c*directions[e]][h+c*directions[e+1]][2],1,50,false,1,board[m][h][7],0,undefined,1]}else{if(board[m][h][7]!=board[m+c*directions[e]][h+c*directions[e+1]][3]){board[m+c*directions[e]][h+c*directions[e+1]]=[4,5+c,board[m+c*directions[e]][h+c*directions[e+1]][2],1,50,false,1,board[m][h][7],0,board[m+c*directions[e]][h+c*directions[e+1]][3],1]}}}else{if(board[m+c*directions[e]][h+c*directions[e+1]][4]!=1&&board[m+c*directions[e]][h+c*directions[e+1]][4]!=2&&board[m+c*directions[e]][h+c*directions[e+1]][4]!=3&&board[m+c*directions[e]][h+c*directions[e+1]][0]!=4&&board[m+c*directions[e]][h+c*directions[e+1]][0]!=5){board[m+c*directions[e]][h+c*directions[e+1]]=[4,1+c,board[m][h][2],0,50-c*3,false,0,board[m][h][7],0]}else{if(board[m+c*directions[e]][h+c*directions[e+1]][4]==1){board[m+c*directions[e]][h+c*directions[e+1]]=[4,1+c,board[m][h][2],0,50-c*3,true,0,board[m][h][7],0];c=1000}else{if(board[m+c*directions[e]][h+c*directions[e+1]][4]==2){c=1000}else{if((board[m+c*directions[e]][h+c*directions[e+1]][0]==5&&board[m+c*directions[e]][h+c*directions[e+1]][2]==false)){if(((board[m+c*directions[e]][h+c*directions[e+1]][1]<(50-c*3))&&(board[m+c*directions[e]][h+c*directions[e+1]][0]==5))||(board[m+c*directions[e]][h+c*directions[e+1]][0]==4&&(board[m+c*directions[e]][h+c*directions[e+1]][1]+board[m+c*directions[e]][h+c*directions[e+1]][4])<(1+c+50-c*3))){board[m+c*directions[e]][h+c*directions[e+1]]=[4,1+c,board[m][h][2],0,50-c*5,false,0,board[m][h][7],0]}}else{if((board[m+c*directions[e]][h+c*directions[e+1]][0]==4&&board[m+c*directions[e]][h+c*directions[e+1]][5]==true)||(board[m+c*directions[e]][h+c*directions[e+1]][0]==5&&board[m+c*directions[e]][h+c*directions[e+1]][2]==true)){if(((board[m+c*directions[e]][h+c*directions[e+1]][1]<(50-c*3))&&(board[m+c*directions[e]][h+c*directions[e+1]][0]==5))||board[m+c*directions[e]][h+c*directions[e+1]][0]==4){board[m+c*directions[e]][h+c*directions[e+1]]=[4,1+c,board[m][h][2],0,50-c*3,true,0,board[m][h][7],0]}c=1000}}}}}}}c++}e=e+2}}if(board[m][h][0]==4&&board[m][h][1]==1&&board[m][h][9]!=undefined){var b=board[m][h];board[m][h]=[5,board[m][h][4],board[m][h][5],board[m][h][7],board[m][h][8],board[m][h][9],1];board[m][h]=board[m][h].concat(b)}else{if(board[m][h][0]==4&&board[m][h][1]>=0){board[m][h][1]--}else{if(board[m][h][0]==4&&board[m][h][1]<=0&&board[m][h][9]==undefined){board[m][h]=[5,board[m][h][4],board[m][h][5],board[m][h][7],board[m][h][8],board[m][h][9],0]}}}if(board[m][h][0]==5&&board[m][h][1]>0){board[m][h][1]--}else{if(board[m][h][0]==5&&board[m][h][1]<=0&&board[m][h][4]==0){board[m][h]=0}else{if(board[m][h][0]==5&&board[m][h][1]<=0&&board[m][h][4]!=0){board[m][h]=board[m][h][4]}}}}}for(var d=0;d<items.length;d++){if(items[d]!=0&&board[items[d][0]][items[d][1]]==0){board[items[d][0]][items[d][1]]=[items[d][2],items[d][3],0,0,0,0,0,0];items[d]=0}}}var bb=window.performance.now();function delta(){var b=window.performance.now(),a=b-bb;bb=b;return a}function loop(){dd=delta();update(dd);clearCanvas();draw()}socket.on("1",function(b){var b=JSON.parse(b);players[b[0]][0]=board_x+Math.round(b[2]*28/22);players[b[0]][1]=board_x+Math.round(b[3]*28/22);for(var a=0;a<keys.length;a++){if(keys[a][0]==b[1]){players[b[0]][10][0]=keys[a][0];players[b[0]][10][1]=keys[a][1];players[b[0]][10][2]=keys[a][2];players[b[0]][10][3]=0}}});socket.on("2",function(a){var a=JSON.parse(a);if(a[0]==8){items.push([a[1],a[2],a[0],300])}else{if(a[0]==5){items.push([a[1],a[2],9,-1])}else{items.push([a[1],a[2],a[0],-1])}}});socket.on("3",function(a){var a=JSON.parse(a);players[a[0]][10][0]=false;players[a[0]][10][1]=false;players[a[0]][10][2]=false;if(a[3]===0){players[a[0]][10][3]=false}players[a[0]][0]=board_x+Math.round(a[1]*28/22);players[a[0]][1]=board_y+Math.round(a[2]*28/22)});socket.on("4",function(c){var c=JSON.parse(c);if(player_num==undefined){player_num=c[1]}board=c[2];players_modified=[];for(var a=0;a<c[0].length;a++){if(c[0][a]!=false){var b=0;if(players[a][20]!=0&&players[a][20]!=undefined){b=players[a][20]}players[a]=[(board_x+Math.round(c[0][a][0]*28/22)),(board_y+Math.round(c[0][a][1]*28/22)),c[0][a][2],c[0][a][3],c[0][a][4],c[0][a][5],c[0][a][6],c[0][a][7],c[0][a][8],c[0][a][9],c[0][a][10],c[0][a][11],a,c[0][a][13],c[0][a][14],c[0][a][15],c[0][a][16],0,14,a,b];if(player_num==a&&players[a][17].length==2){}else{players[a][17]=[c[0][a][17],"white",false]}}}players_modified=[];for(var a=0;a<players.length;a++){if(players[a]!=false){players_modified.push(players[a])}}players_modified.sort(function(d,e){return e[16]-d[16]})});socket.on("5",function(b){var b=JSON.parse(b);console.log(b);board=b[1];for(var a=0;a<players.length;a++){if(players[a]!=false){players[a][0]=board_x+Math.round(b[0][2*a]*28/22);players[a][1]=board_y+Math.round(b[0][2*a+1]*28/22);players[a][6]=true;players[a][7]=1;players[a][8]=2;players[a][9]=1.375;players[a][11]=300}}});socket.on("6",function(a){var a=JSON.parse(a);if(a[0]==player_num){}if(a[1]==7){players[a[0]][a[1]]++}else{if(a[1]==8){players[a[0]][a[1]]++}else{if(a[1]==9){if(players[a[0]][a[1]]==1.5714285){players[a[0]][a[1]]=2}else{if(players[a[0]][a[1]]==1.375){players[a[0]][a[1]]=1.5714285}}players[a[0]][0]=board_x+(a[4]*28/22);players[a[0]][1]=board_y+(a[5]*28/22)}else{if(a[1]==11&&a[0]!="OK"){players[a[0]][a[1]]=450}}}}board[a[2]][a[3]]=0});socket.on("7",function(a){var a=JSON.parse(a);players[a[0]][17]=[a[1],"white",false]});socket.on("8",function(b){players[b]=false;players_modified=[];for(var a=0;a<players.length;a++){if(players[a]!=false){players_modified.push(players[a])}}players_modified.sort(function(c,d){return d[16]-c[16]})});socket.on("9",function(a){var a=JSON.parse(a);if(a[4]==120){board[a[0]][a[1]]=[3,a[4],a[2],a[3],Math.floor((players[a[3]][0]+11)/22)*22,Math.floor((players[a[3]][0]+11)/22)*22,22,22,1]}else{if(a[4]==5){}}});socket.on("0",function(){login=true});socket.on("10",function(b){var b=JSON.parse(b);players[b[0]][16]=b[1];players[b[2]][6]=90;players_modified=[];for(var a=0;a<players.length;a++){if(players[a]!=false){players_modified.push(players[a])}}players_modified.sort(function(c,d){return d[16]-c[16]})});socket.on("11",function(a){var a=JSON.parse(a);players[a[0]][0]=board_x+(a[1]*28/22);players[a[0]][1]=board_y+(a[2]*28/22);players[a[0]][6]=true;players[a[0]][7]=1;players[a[0]][8]=2;players[a[0]][9]=1.375;players[a[0]][11]=300});
I've read forums en articles about using nodejs en run it in cmd prompt or something.

Please could someone tell me how I can run this game on my local host?
I've tried alot of stuff, but really don't know how I can make it working.

I can pay anyone who could help me.