ios safari indicator keeps spinning on cross domain.
However, when i use same origin, ios safari indicator does not spin.
I guess "polling" connection keeps and does not close the transport even if upgrade to websocket on cross domain.
I used Safari debug tool, and see the timeline, But I can't find the polling connection...
var static = require('node-static');
var file = new static.Server('.');
server = require('http').createServer(function (request, response) {
request.addListener('end', function () {
file.serve(request, response);
}).resume();
});
// different origin, static file server port is 60000
server.listen(60000);
// but socket.io server port is 60001
var io = require('socket.io').listen(60001);
io.sockets.on('connection', function(socket){
socket.on('message', function(){
socket.emit("reply","hello");
});
socket.on('disconnect', function(){});
});
<!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", "polling"]});
socket.on('connect', function() {
socket.emit("message","hay");
});
socket.on('reply', function(msg) {
document.getElementById("Continar").innerHTML = msg;
});
</script>
</body>
</html>
client transports order change, the indicator does not spin.
<!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", "polling"]});
socket.on('connect', function() {
socket.emit("message","hay");
});
socket.on('reply', function(msg) {
document.getElementById("Continar").innerHTML = msg;
});
</script>
</body>
</html>