Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Server): add sockJsUrl option (options.sockJsUrl) #1335

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/Server.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ function Server(compiler, options, _log) {
this.sockets = [];
this.contentBaseWatchers = [];
this.watchOptions = options.watchOptions || {};
this.sockjsUrl = options.sockjsUrl || '/sockjs-node';

// Listening for events
const invalidPlugin = () => {
Expand Down Expand Up @@ -611,7 +612,7 @@ Server.prototype.listen = function (port, hostname, fn) {
});

sockServer.installHandlers(this.listeningApp, {
prefix: '/sockjs-node'
prefix: this.sockjsUrl
});

if (fn) {
Expand Down
4 changes: 4 additions & 0 deletions lib/optionsSchema.json
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,10 @@
"warn": {
"description": "Customize warn logs for webpack-dev-middleware.",
"instanceof": "Function"
},
"sockjsUrl": {
"description": "Customize url at which the sockjs server listens, defaults to /sockjs-node",
"type": "string"
}
},
"type": "object"
Expand Down