<!DOCTYPE html>
<html>
<head>
<title>sample</title>
</head>
<body>
<div id="Continar">
</div>
<script src="http://localhost:60001/socket.io/socket.io.js"></script>
<script>
var socket = io.connect('http://localhost:60001', {transports: ["websocket"]});
socket.on('connect', function() {
socket.emit("message","hay");
});
socket.on('reply', function(msg) {
document.getElementById("Continar").innerHTML = msg;
});
</script>
</body>
</html>
Created
June 18, 2014 14:10
-
-
Save yosuke-furukawa/a8aff7bfdaa367f0f6fd to your computer and use it in GitHub Desktop.
socket.io- websocket
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment