Thanks for the reply,
Can't we use proxy servers 
(https://emscripten.org/docs/porting/networking.html#full-posix-sockets-over-websocket-proxy-server)
 
to do so?

On Monday, October 10, 2022 at 4:52:54 PM UTC+5:30 Floh wrote:

> typo: "Emscripten's TCP API" should better be "Emscripten socket API".
>
> On Monday, 10 October 2022 at 13:22:14 UTC+2 Floh wrote:
>
>> I might be wrong but I don't think that's possible. First, you can't 
>> expose a TCP-compatible socket in browsers (Emscripten's TCP API is an 
>> emulation wrapper over WebSockets, which are not protocol-compatible with 
>> 'raw' TCP).
>>
>> WebSocket in the browser can only implement a client interface (e.g. it 
>> cannot accept incoming connections, only connect to a 'native' WebSocket 
>> server).
>>
>> WebRTC data channels might allow to implement something that looks like a 
>> server running in a browser (because it's a peer-to-peer connection 
>> system), but you couldn't connect with a regular TCP or WebSocket client, 
>> only with a client that also uses the WebRTC data channel protocol.
>>
>> On Saturday, 8 October 2022 at 17:00:21 UTC+2 [email protected] wrote:
>>
>>> Could anyone provide a sample code for creating a socket server code 
>>> that can also work from web browsers and accept incoming connections?
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/49ad373b-cd14-41dd-9fb0-b52b979b2d6en%40googlegroups.com.

Reply via email to