Skip to content

Commit

Permalink
fix getMuxWSUrl for location.pathname other than "/" (#396)
Browse files Browse the repository at this point in the history
  • Loading branch information
etpinard authored Apr 14, 2020
1 parent 549594a commit de95ec7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/mux-provider/src/mux.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import WebIO from "@webio/webio";
export const getMuxWSUrl = (): string => {
const {protocol, host, pathname} = window.location;
const wsProtocol = protocol == "https:" ? "wss:" : "ws:";
const basePath = pathname[pathname.length - 1] == "/" ? pathname : pathname + "/";
const wsPath = basePath + "webio-socket";
const wsPath = "/webio-socket" + pathname;

return `${wsProtocol}//${host}${wsPath}`;
};
Expand Down

0 comments on commit de95ec7

Please sign in to comment.