normalize-ws-url-protocol
v1.0.1
Published
Use ws:// or wss:// depending on environment.
Downloads
31
Maintainers
Readme
Normalize ws url protocol
Use ws:// or wss:// depending on environment (if https or not).
Installation
$ npm i normalize-ws-url-protocol
Usage
import normalizeWsUrlProtocol from "normalize-ws-url-protocol"
normalizeWsUrlProtocol("/ws") // ws://localhost/ws // wss://example.com/ws
normalizeWsUrlProtocol("https://example.com") // wss://example.com
Contribute
All feedback is appreciated. Create a pull request or write an issue.