Skip to content

Instantly share code, notes, and snippets.

@johnSerrano
Created June 27, 2016 17:44
Show Gist options
  • Save johnSerrano/c0eb75b8f375f03cff14d1149fce98cb to your computer and use it in GitHub Desktop.
Save johnSerrano/c0eb75b8f375f03cff14d1149fce98cb to your computer and use it in GitHub Desktop.
test for socket
<!DOCTYPE HTML>
<html>
<head>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/socket.io/1.3.5/socket.io.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
<script>
$(document).ready(function() {
var socket = io.connect('http://' + document.domain + ':' + location.port);
var hello = {"id": "asDFasDF12", "word_1": "Flask", "word_2": "Sockets", }
socket.emit("hello", hello);
});
</script>
</head>
<body>
<div>Hello</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment