(location: Location)
| 136 | } |
| 137 | |
| 138 | export function getWebSocketUrl(location: Location) { |
| 139 | const hostname = location.hostname; |
| 140 | const protocol = location.protocol === 'https:' ? 'wss' : 'ws'; |
| 141 | const defaultport = location.protocol === 'https:' ? '443' : '80'; |
| 142 | const path = location.pathname; |
| 143 | const port = location.port === defaultport ? '' : `:${location.port}`; |
| 144 | return `${protocol}://${hostname}${port}${path}ws`; |
| 145 | } |
no outgoing calls
no test coverage detected