我想在我的rails应用程序中使用slanger(在我的php-App中效果很好),但我没有得到任何连接。
192.168.56.101是我当地的Slanger-Server,我用它开始了:
slanger -k 123 -s 123 -w 192.168.56.101:8080
我的配置/初始化程序/ pusher.rb
Pusher.url = "192.168.56.101"
Pusher.port = 4657
Pusher.app_id = 123
Pusher.key = 123
Pusher.secret = 123
我的客户端脚本如下所示:
<script type="text/javascript">
Pusher.host = '192.168.56.101'
Pusher.ws_port = 8080
Pusher.wss_port = 8080
var pusher = new Pusher('123');
var channel = pusher.subscribe('test');
channel.bind('my_event', function(data) {
alert( data.message );
});
Pusher.log = function(data) {
console.log('\t\t', data);
};
</script>
在我的firebug-console中我得到了这个:
Pusher : State changed : initialized -> connecting
Pusher : Connecting : ws://192.168.56.101:8080/app/123?protocol=5&client=js&version=1.12.5&flash=false
Firefox kann keine Verbindung zu dem Server unter ws://192.168.56.101:8080/app/123?protocol=5&client=js&version=1.12.5&flash=false aufbauen.
Pusher : Connecting : wss://192.168.56.101:8080/app/123?protocol=5&client=js&version=1.12.5&flash=false
Firefox kann keine Verbindung zu dem Server unter wss://192.168.56.101:8080/app/123?protocol=5&client=js&version=1.12.5&flash=false aufbauen.
Pusher : Error : {"type":"WebSocketError","error":{"isTrusted":true}}
Pusher : State changed : connecting -> unavailable
答案 0 :(得分:0)
这是一个iptables问题。 羞辱我