Skip to content

Commit 41ceb4b

Browse files
committed
Revert "Sockjs prefix config (#911)"
This reverts commit ccd113a.
1 parent c8b9a0f commit 41ceb4b

File tree

9 files changed

+3
-80
lines changed

9 files changed

+3
-80
lines changed

client/index.js

+1-9
Original file line numberDiff line numberDiff line change
@@ -170,20 +170,12 @@ if(hostname && (self.location.protocol === "https:" || urlParts.hostname === "0.
170170
protocol = self.location.protocol;
171171
}
172172

173-
var rootPathName = url.parse(__webpack_public_path__).pathname || ""; // eslint-disable-line no-undef
174-
175-
if(rootPathName.length > 1) {
176-
rootPathName = rootPathName.replace(/\/+$/, "");
177-
}
178-
179-
var sockjsPath = rootPathName + "/sockjs-node";
180-
181173
var socketUrl = url.format({
182174
protocol: protocol,
183175
auth: urlParts.auth,
184176
hostname: hostname,
185177
port: (urlParts.port === "0") ? self.location.port : urlParts.port,
186-
pathname: urlParts.path == null || urlParts.path === "/" ? sockjsPath : urlParts.path
178+
pathname: urlParts.path == null || urlParts.path === "/" ? "/sockjs-node" : urlParts.path
187179
});
188180

189181
socket(socketUrl, onSocketMsg);

examples/node-api-sockjs-prefix/README.md

-15
This file was deleted.

examples/node-api-sockjs-prefix/app.js

-7
This file was deleted.

examples/node-api-sockjs-prefix/index.html

-9
This file was deleted.

examples/node-api-sockjs-prefix/server.js

-25
This file was deleted.

examples/node-api-sockjs-prefix/webpack.config.js

-8
This file was deleted.

lib/Server.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ function Server(compiler, options) {
4242
this.disableHostCheck = !!options.disableHostCheck;
4343
this.publicHost = options.public;
4444
this.allowedHosts = options.allowedHosts;
45-
this.sockjsPrefix = options.sockjsPrefix || ""
4645
this.sockets = [];
4746
this.contentBaseWatchers = [];
4847

@@ -521,7 +520,7 @@ Server.prototype.listen = function(port, hostname) {
521520
});
522521

523522
sockServer.installHandlers(this.listeningApp, {
524-
prefix: `${this.sockjsPrefix}/sockjs-node`
523+
prefix: "/sockjs-node"
525524
});
526525
return returnValue;
527526
}

lib/optionsSchema.json

-4
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,6 @@
5454
}
5555
]
5656
},
57-
"sockjsPrefix": {
58-
"description": "Optional prefix for the sockjs handler to be mounted to.",
59-
"type": "string"
60-
},
6157
"socket": {
6258
"description": "The Unix socket to listen to (instead of on a host).",
6359
"type": "string"

test/Validation.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ describe("Validation", function() {
4848
config: { asdf: true },
4949
message: [
5050
" - configuration has an unknown property 'asdf'. These properties are valid:",
51-
" object { hot?, hotOnly?, lazy?, bonjour?, host?, allowedHosts?, filename?, publicPath?, port?, sockjsPrefix?, socket?, " +
51+
" object { hot?, hotOnly?, lazy?, bonjour?, host?, allowedHosts?, filename?, publicPath?, port?, socket?, " +
5252
"watchOptions?, headers?, clientLogLevel?, overlay?, key?, cert?, ca?, pfx?, pfxPassphrase?, " +
5353
"inline?, disableHostCheck?, public?, https?, contentBase?, watchContentBase?, open?, useLocalIp?, openPage?, features?, " +
5454
"compress?, proxy?, historyApiFallback?, staticOptions?, setup?, stats?, reporter?, " +

0 commit comments

Comments
 (0)