mirror of
https://github.com/cypress-io/cypress.git
synced 2026-01-06 22:49:46 -06:00
* chore(deps): update dependency devtools-protocol to v0.0.1346313 * empty commit * patch updated types for our devtools-protocol version * dev patch * Revert "dev patch" This reverts commit031b00df5f. * Revert "patch updated types for our devtools-protocol version" This reverts commit44b31a3414. * try to set devtools-protocol resolution --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
Socket
This is a shared lib for holding both the socket.io server and client.
Using
const socket = require("@packages/socket")
// returns
{
server: require("socket.io"),
getPathToClientSource: function () {
// returns path to the client 'socket.io.js' file
// for use in the browser
}
}
const socket = require("@packages/socket")
// server usage
const srv = require("http").createServer()
const io = socket.server(srv)
io.on("connection", function(){})
// client usage
const { client } = require("@packages/socket/lib/client")
const client = socket.client("http://localhost:2020")
client.on("connect", function(){})
client.on("event", function(){})
client.on("disconnect", function(){})
// path usage
socket.getPathToClientSource()
// returns your/path/to/node_modules/socket.io-client/socket.io.js0
Testing
yarn workspace @packages/socket test