我遇到了websockets的麻烦......我被告知使用websockets我的托管服务计划应该有一个名为“VPS”的功能......所以我升级到那个计划,当使用angular时,我看到了这条消息在firefox的日志控制台上......
Firefox no puede establecerunaconexiónconel servidor en ws://cholordoweb.com:1234 / test /。
或
Firefox无法建立与ws的连接
我知道有类似的问题,但是......我提供了更多细节......谢谢!。
我的firefox版本是41.0 ......
<html ng-app="CholoApp">
<head>
<script src="angular.min.1.3.9.js" type="text/javascript"></script>
<script src="ng-websocket.js" type="text/javascript"></script>
<script type="text/javascript">
var CholoApp = angular.module("CholoApp",['ngWebsocket']);
CholoApp.controller("CholoController",function($scope,$websocket){
var ws = $websocket.$new('ws://cholordoweb.com:1234/test/');
ws.$on('cholordo', function (message) { // it listents for 'incoming event'
alert("Mensaje: " + message);
});
});
</script>
</head>
<body ng-controller="CholoController">
</body>
另一个是:
<html ng-app="CholoApp">
<head>
<script src="angular.min.1.3.9.js" type="text/javascript"></script>
<script src="ng-websocket.js" type="text/javascript"></script>
<script type="text/javascript">
var CholoApp = angular.module("CholoApp",['ngWebsocket']);
CholoApp.controller("CholoController",function($scope,$websocket){
var ws = $websocket.$new('ws://cholordoweb.com:1234/test/');
ws.$emit('cholordo', 'Cholo WebSocket Is Working !.'); // it sends the event 'hello' with data 'world'
});
</script>
</head>
<body ng-controller="CholoController">
</body>
可能会发生什么?。我怎么能解决它?我应该提出任何细节......谢谢你