transferring files with javascript through websockets

前端 未结 2 2153
忘了有多久
忘了有多久 2021-02-10 03:46

hello i am trying to transfer files. I have some programs converting files to binary and transferring them over a network with c++. I was wondering if i would be able to transfe

2条回答
  •  忘了有多久
    2021-02-10 04:10

    What you're trying to do isn't possible. WebSocket can only operate in a client mode; it cannot accept connections from another WebSocket client (such as another browser).

    It is possible to hook WebSocket clients to one another through a server, but at that point it's no longer really peer-to-peer, so I'm not sure if that's really useful or interesting anymore.

    See: Will Websockets allow a server to run in the browser?

提交回复
热议问题