Why am I unable to send response object of Express through SocketIO?
问题 I'm trying to send the response to an express request by sending it to a ws client and wait for its response. So I need to send the res object to the client (I couldn't find another way). Here is what I did: var app = require('express')(); var http = require('http').Server(app); var io = require('socket.io')(http); app.get('/', (req, res) => { res.sendFile(__dirname + '/index.html'); }); io.on('connection', (socket) => { socket.on('res', (e) => { e.res.send(e.data) }) }) app.get('/endpoint',