@hippy/debug-server-next
Version:
Debug server for hippy.
20 lines (16 loc) • 376 B
JavaScript
import url from 'url';
function createSocketURL(parsedURL) {
const { protocol, hostname, port, pathname, hash, role } = parsedURL;
return url.format({
protocol: protocol || 'ws:',
hostname: hostname || 'localhost',
port,
pathname: pathname || '/ws',
slashes: true,
query: {
hash,
role,
},
});
}
export default createSocketURL;