@@ -46,6 +46,10 @@ function Server(compiler, options) {
46
46
var inlinedJs = new StreamCache ( ) ;
47
47
fs . createReadStream ( path . join ( __dirname , ".." , "client" , "index.bundle.js" ) ) . pipe ( inlinedJs ) ;
48
48
49
+ // Prepare the sockjs js file
50
+ var sockjsJs = new StreamCache ( ) ;
51
+ fs . createReadStream ( path . join ( __dirname , ".." , "client" , "sockjs.bundle.js" ) ) . pipe ( sockjsJs ) ;
52
+
49
53
// Init express server
50
54
var app = this . app = new express ( ) ;
51
55
@@ -57,6 +61,11 @@ function Server(compiler, options) {
57
61
liveJs . pipe ( res ) ;
58
62
} ) ;
59
63
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
+
60
69
app . get ( "/webpack-dev-server.js" , function ( req , res ) {
61
70
res . setHeader ( "Content-Type" , "application/javascript" ) ;
62
71
inlinedJs . pipe ( res ) ;
@@ -318,7 +327,9 @@ Server.prototype.listen = function() {
318
327
if ( severity === "error" ) {
319
328
console . log ( line ) ;
320
329
}
321
- }
330
+ } ,
331
+ // Use provided up-to-date sockjs-client
332
+ sockjs_url : "/__webpack_dev_server__/sockjs.bundle.js"
322
333
} ) ;
323
334
sockServer . on ( "connection" , function ( conn ) {
324
335
this . sockets . push ( conn ) ;
0 commit comments