我通过WebSocket与Stomp连接,看起来像是
var authenticity_token = {authenticity_token: $cookies.get('XSRF-TOKEN')};
var ws = new WebSocket(GlobalSettings.STOMP_URL);
var stomp = Stomp.over(ws);
$scope.allRequests = [];
stomp.connect( {}, authenticity_token, function(){
$scope.allRequests.forEach(function(requestId){
stomp.subscribe('/stomplets/eventable/update/request/id=' + requestId, function(message){
$scope.liveUpdateState(JSON.parse(message.body));
});
});
});
但我不知道如何测试。请帮帮我。