Hi all 

I manged to run the example in https://github.com/amol-/tgext.socketio
but if upgrade the socket.io  library to 1.3.7 it does not work anymore.
.
<script 
src="//cdnjs.cloudflare.com/ajax/libs/socket.io/1.3.7/socket.io.js"></script>
I tried using and other combinations:
var socket = io(window.location.protocol + '//localhost/pingpong', { 
'multiplex': false, 'path': '/socketio'});

But no success with error like this:

XMLHttpRequest cannot load 
http://localhost/socketio/?EIO=3&transport=polling&t=1443890999903-2. No 
'Access-Control-Allow-Origin' header is present on the requested resource. 
Origin 'http://localhost:9999' is therefore not allowed access. The 
response had HTTP status code 404.

Any ideas ?

G


<body>
<div>
<a class="ping" href="#" data-attack="ping">Ping</a>
<a class="ping" href="#" data-attack="fireball">Fireball</a>
<a class="ping" href="#" data-attack="auto">Auto</a>
<a class="ping" href="#" data-attack="error">Error</a>
</div>
<div id="result"></div>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js
"></script>
<script src="//
cdnjs.cloudflare.com/ajax/libs/socket.io/0.9.16/socket.io.min.js"></script>
<script>
$(function(){
var socket = io.connect('/pingpong', {'resource':'socketio'});
socket.on('pong',function(data){
$('#result').append(data.sound + '<br/>');
});
socket.on('error',function(error, info) {
if (error == 'method_access_denied') { alert(info); }
else { console.log(info); alert(error); }
});
$('.ping').click(function(event){
event.preventDefault();
socket.emit('ping',{'type':$(this).data('attack')});
});
});
</script>
</body>
</html>

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.

Reply via email to