Skip to content

Instantly share code, notes, and snippets.

@CoinArcade
CoinArcade / socket.io.js
Last active January 8, 2022 07:47 — forked from naholyr/socket.io.js
socket.io.js
/*! Socket.IO.js build:0.9.6, development. Copyright(c) 2011 LearnBoost <[email protected]> MIT Licensed */
/**
* socket.io
* Copyright(c) 2011 LearnBoost <[email protected]>
* MIT Licensed
*/
(function (exports, global) {
@CoinArcade
CoinArcade / multi-player-html5-games-01-socket.io-server.js
Created January 8, 2022 07:47 — forked from ruby0x1/multi-player-html5-games-01-socket.io-server.js
Multi-player games in HTML5 : Setting up Socket.io on the server side
//Create and listen for clients on the existing web server
//we created above. app is the express server.
var io = require('socket.io').listen( app );
//We also introduce a UUID library, for unique identifiers.
//Not required, but I find useful.
var UUID = require('node-uuid');
/* Socket.io Configuration */
<!DOCTYPE html>
<html>
<head>
<title> Real time multi-player games with HTML5</title>
<style type="text/css">
html , body {
<link href="../game-b/game-b.html" rel="import">
<link href="../game-bbar/game-bbar.html" rel="import">
<link href="../game-pa/game-pa.html" rel="import">
<link href="../game-deck/game-deck.html" rel="import">
<link href="../game-setup/game-setup.html" rel="import">
<link href="../game-coinbar/game-coinbar.html" rel="import">
<link href="../core-overlay/core-overlay.html" rel="import">
<link href="../paper-toast/paper-toast.html" rel="import">
<polymer-element name="game-container">