How to upload pictures through web pages and transmit them directly to another server through tcp in the background?

  node.js, question

I want to realize the function of uploading web pictures through nodejs. I used several methods of uploading and analyzing pictures on the server side, and they all saved pictures to a specific directory for me. But I want to transfer the upload stream directly to another server through tcp socket. Can you tell me how to intercept the uploaded stream?

Intercepting the uploaded stream may not be easy to implement. Considering that the upload time on the web side is uncertain, you can upload and save the picture by using the web method first, and then write it to another server by using Socket at the specified time point.
Also, if you want to get pictures in real time, it is recommended to consider websocket.