Skip to content

Instantly share code, notes, and snippets.

@mathdoodle
Last active April 9, 2021 19:56
Show Gist options
  • Save mathdoodle/41e3aaafcc342b80beb1970d1653bc96 to your computer and use it in GitHub Desktop.
Save mathdoodle/41e3aaafcc342b80beb1970d1653bc96 to your computer and use it in GitHub Desktop.
socket.io

Using socket.io to communicate with a Node.JS

Overview

To run this sample you will need a Node server running on port 3000.

You will also need to run STEMCstudio from an unsecure URL.

<!DOCTYPE html>
<html>
<head>
<!-- STYLES-MARKER -->
<style>
/* STYLE-MARKER */
</style>
<script src='https://jspm.io/system.js'></script>
<!-- SHADERS-MARKER -->
<!-- SCRIPTS-MARKER -->
</head>
<body>
<script>
// CODE-MARKER
</script>
<script>
System.import('./index.js')
</script>
</body>
</html>
const socket = io('localhost:3000')
{
"description": "socket.io",
"dependencies": {
"DomReady": "1.0.0",
"socket.io-client": "1.5.1",
"jasmine": "3.4.0"
},
"name": "",
"version": "",
"author": "David Geo Holmes"
}
body {
background-color: white;
}
{
"allowJs": true,
"checkJs": true,
"declaration": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"jsx": "react",
"module": "system",
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"preserveConstEnums": true,
"removeComments": false,
"skipLibCheck": true,
"sourceMap": true,
"strictNullChecks": true,
"suppressImplicitAnyIndexErrors": true,
"target": "es5",
"traceResolution": true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment