Skip to content

Commit 0f0d0fd

Browse files
committed
fix(gen:app:socket): use '' instead null as URL to open ioSocket
With socket.io 1.0.6, when opening ioSocket with null as URL, io() will omit the option object. As a result, `query` and Auth Token will not be sent through handshake.
1 parent f5ca531 commit 0f0d0fd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/templates/client/components/socket(socketio)/socket.service(coffee).coffee

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ angular.module '<%= scriptAppName %>'
66
.factory 'socket', (socketFactory) ->
77

88
# socket.io now auto-configures its connection when we omit a connection url
9-
ioSocket = io null,
9+
ioSocket = io '',
1010
'reconnection limit': 10 * 1000
1111
# Send auth token on connection, you will need to DI the Auth service above
1212
# 'query': 'token=' + Auth.getToken()

app/templates/client/components/socket(socketio)/socket.service.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ angular.module('<%= scriptAppName %>')
55
.factory('socket', function(socketFactory) {
66

77
// socket.io now auto-configures its connection when we ommit a connection url
8-
var ioSocket = io(null, {
8+
var ioSocket = io('', {
99
// Send auth token on connection, you will need to DI the Auth service above
1010
// 'query': 'token=' + Auth.getToken()
1111
});

0 commit comments

Comments
 (0)