How to use the apply function from superagent

Find comprehensive JavaScript superagent.apply code examples handpicked from public code repositorys.

1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
// hack to access the sockets created by node-xmlhttprequest
// see: https://github.com/driverdan/node-XMLHttpRequest/issues/44
const request = require("http").request;
const sockets = [];
http.request = function (opts) {
  const req = request.apply(null, arguments);
  req.on("socket", (socket) => {
    sockets.push(socket);
  });
  return req;
fork icon602
star icon0
watch icon237