mirror of
https://github.com/socketio/socket.io.git
synced 2026-04-30 03:00:39 -04:00
A polyfill for Node.js "process" was included in the final bundle. Reference: https://webpack.js.org/configuration/node/
16 lines
409 B
JavaScript
16 lines
409 B
JavaScript
// WARNING this is bad practice
|
|
// we only do this in our tests because we need to test engine.io-client
|
|
// support in browsers and in node.js
|
|
// some tests do not yet work in both
|
|
exports.browser = typeof window !== "undefined";
|
|
exports.node = !exports.browser;
|
|
|
|
if (exports.node) {
|
|
global.location = {
|
|
protocol: "http:",
|
|
host: "localhost:3210",
|
|
hostname: "localhost",
|
|
port: "3210",
|
|
};
|
|
}
|