File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ export class ReconnectingSocket {
44
44
45
45
private _binaryType : typeof WebSocket . prototype . binaryType = "arraybuffer"
46
46
47
- public constructor ( private customPath ? : string , public readonly id : string = generateUuid ( 4 ) ) {
47
+ public constructor ( private path : string , public readonly id : string = generateUuid ( 4 ) ) {
48
48
// On Firefox the socket seems to somehow persist a page reload so the close
49
49
// event runs and we see "attempting to reconnect".
50
50
if ( typeof window !== "undefined" ) {
@@ -155,12 +155,8 @@ export class ReconnectingSocket {
155
155
this . logger . info ( `retrying in ${ this . retryDelay } ms...` )
156
156
}
157
157
setTimeout ( ( ) => {
158
- this . logger . info ( "connecting..." )
159
- const socket = new WebSocket (
160
- `${ location . protocol === "https:" ? "wss" : "ws" } ://${ location . host } ${ this . customPath || location . pathname } ${
161
- location . search ? `?${ location . search } ` : ""
162
- } `,
163
- )
158
+ this . logger . info ( "connecting..." , field ( "path" , this . path ) )
159
+ const socket = new WebSocket ( this . path )
164
160
165
161
const reject = ( ) : void => {
166
162
_reject ( new Error ( "socket closed" ) )
You can’t perform that action at this time.
0 commit comments