PHP 8.2.30
Preview: ws.js Size: 1.62 KB
/proc/thread-self/root/usr/lib/node_modules/npm/node_modules/uri-js/dist/esnext/schemes/ws.js

function isSecure(wsComponents) {
    return typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss";
}
//RFC 6455
const handler = {
    scheme: "ws",
    domainHost: true,
    parse: function (components, options) {
        const wsComponents = components;
        //indicate if the secure flag is set
        wsComponents.secure = isSecure(wsComponents);
        //construct resouce name
        wsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : '');
        wsComponents.path = undefined;
        wsComponents.query = undefined;
        return wsComponents;
    },
    serialize: function (wsComponents, options) {
        //normalize the default port
        if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") {
            wsComponents.port = undefined;
        }
        //ensure scheme matches secure flag
        if (typeof wsComponents.secure === 'boolean') {
            wsComponents.scheme = (wsComponents.secure ? 'wss' : 'ws');
            wsComponents.secure = undefined;
        }
        //reconstruct path from resource name
        if (wsComponents.resourceName) {
            const [path, query] = wsComponents.resourceName.split('?');
            wsComponents.path = (path && path !== '/' ? path : undefined);
            wsComponents.query = query;
            wsComponents.resourceName = undefined;
        }
        //forbid fragment component
        wsComponents.fragment = undefined;
        return wsComponents;
    }
};
export default handler;
//# sourceMappingURL=ws.js.map

Directory Contents

Dirs: 0 × Files: 21

Name Size Perms Modified Actions
108 B lrw-r--r-- 2021-03-10 14:36:39
Edit Download
959 B lrw-r--r-- 2021-03-10 14:36:39
Edit Download
841 B lrw-r--r-- 2021-03-10 14:36:39
Edit Download
108 B lrw-r--r-- 2021-03-10 14:36:39
Edit Download
212 B lrw-r--r-- 2021-03-10 14:36:39
Edit Download
312 B lrw-r--r-- 2021-03-10 14:36:39
Edit Download
359 B lrw-r--r-- 2021-03-10 14:36:39
Edit Download
7.56 KB lrw-r--r-- 2021-03-10 14:36:39
Edit Download
7.04 KB lrw-r--r-- 2021-03-10 14:36:39
Edit Download
279 B lrw-r--r-- 2021-03-10 14:36:39
Edit Download
868 B lrw-r--r-- 2021-03-10 14:36:39
Edit Download
832 B lrw-r--r-- 2021-03-10 14:36:39
Edit Download
324 B lrw-r--r-- 2021-03-10 14:36:39
Edit Download
2.00 KB lrw-r--r-- 2021-03-10 14:36:39
Edit Download
1.89 KB lrw-r--r-- 2021-03-10 14:36:39
Edit Download
228 B lrw-r--r-- 2021-03-10 14:36:39
Edit Download
1.62 KB lrw-r--r-- 2021-03-10 14:36:39
Edit Download
1.57 KB lrw-r--r-- 2021-03-10 14:36:39
Edit Download
108 B lrw-r--r-- 2021-03-10 14:36:39
Edit Download
198 B lrw-r--r-- 2021-03-10 14:36:39
Edit Download
307 B lrw-r--r-- 2021-03-10 14:36:39
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).