File tree 2 files changed +16
-5
lines changed
2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -216,7 +216,7 @@ Server.prototype.attach = function(srv, opts){
216
216
217
217
// set engine.io path to `/socket.io`
218
218
opts = opts || { } ;
219
- opts . path = opts . path || '/socket.io' ;
219
+ opts . path = opts . path || this . path ( ) ;
220
220
// set origins verification
221
221
opts . allowRequest = this . checkRequest . bind ( this ) ;
222
222
Original file line number Diff line number Diff line change @@ -51,10 +51,21 @@ describe('socket.io', function(){
51
51
expect ( srv . eio . maxHttpBufferSize ) . to . eql ( 10 ) ;
52
52
} ) ;
53
53
54
- it ( 'should be able to set path with setting resource' , function ( ) {
55
- var srv = io ( http ( ) ) ;
56
- srv . set ( 'resource' , '/random' ) ;
57
- expect ( srv . path ( ) ) . to . be ( '/random' ) ;
54
+ it ( 'should be able to set path with setting resource' , function ( done ) {
55
+ var eio = io ( ) ;
56
+ var srv = http ( ) ;
57
+
58
+ eio . set ( 'resource' , '/random' ) ;
59
+ eio . attach ( srv ) ;
60
+
61
+ // Check that the server is accessible through the specified path
62
+ request ( srv )
63
+ . get ( '/random/socket.io.js' )
64
+ . buffer ( true )
65
+ . end ( function ( err , res ) {
66
+ if ( err ) return done ( err ) ;
67
+ done ( ) ;
68
+ } ) ;
58
69
} ) ;
59
70
60
71
it ( 'should be able to set origins to engine.io' , function ( ) {
You can’t perform that action at this time.
0 commit comments