Skip to content

Commit

Permalink
feat(socket.io-client): allow passing options to socket on client
Browse files Browse the repository at this point in the history
affects: @tao.js/socket.io

pass an io prop with options to be used in the client socket constructor
!! very important to pass withCredentials: true option so that
   sticky session cookies by load balancers will be passed on
   requests back to the server
  • Loading branch information
eudaimos committed Jan 31, 2023
1 parent aeeb44b commit ea0b59c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/tao-socket-io/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default function wireTaoJsToSocketIO(TAO, io, opts = {}) {
if (!IS_SERVER) {
if (io && typeof io === 'function') {
const host = opts.host || '';
const socket = io(`${host}/${ns}`);
const socket = io(`${host}/${ns}`, opts.io);
const source = decorateNetwork(TAO, socket);
return socket;
}
Expand Down

0 comments on commit ea0b59c

Please sign in to comment.