@@ -46,6 +46,10 @@ function Server(compiler, options) {
4646 var inlinedJs = new StreamCache ( ) ;
4747 fs . createReadStream ( path . join ( __dirname , ".." , "client" , "index.bundle.js" ) ) . pipe ( inlinedJs ) ;
4848
49+ // Prepare the sockjs js file
50+ var sockjsJs = new StreamCache ( ) ;
51+ fs . createReadStream ( path . join ( __dirname , ".." , "client" , "sockjs.bundle.js" ) ) . pipe ( sockjsJs ) ;
52+
4953 // Init express server
5054 var app = this . app = new express ( ) ;
5155
@@ -57,6 +61,11 @@ function Server(compiler, options) {
5761 liveJs . pipe ( res ) ;
5862 } ) ;
5963
64+ app . get ( "/__webpack_dev_server__/sockjs.bundle.js" , function ( req , res ) {
65+ res . setHeader ( "Content-Type" , "application/javascript" ) ;
66+ sockjsJs . pipe ( res ) ;
67+ } ) ;
68+
6069 app . get ( "/webpack-dev-server.js" , function ( req , res ) {
6170 res . setHeader ( "Content-Type" , "application/javascript" ) ;
6271 inlinedJs . pipe ( res ) ;
@@ -318,7 +327,9 @@ Server.prototype.listen = function() {
318327 if ( severity === "error" ) {
319328 console . log ( line ) ;
320329 }
321- }
330+ } ,
331+ // Use provided up-to-date sockjs-client
332+ sockjs_url : "/__webpack_dev_server__/sockjs.bundle.js"
322333 } ) ;
323334 sockServer . on ( "connection" , function ( conn ) {
324335 this . sockets . push ( conn ) ;
0 commit comments