Hi,

did  you have a look at the examples in :
https://github.com/emscripten-core/emscripten/tree/master/tests/websocket
?
<https://github.com/emscripten-core/emscripten/tree/master/tests/websocket>

On Thu, Aug 27, 2020 at 7:37 PM Harsh chopra <
[email protected]> wrote:

> I build a simple posix socket server to listen on localhost and convert
> the program with emcc to make it compatible on browser(Firefox) but nothing
> worked,  I tried everything upto my potential and I am really confused now.
>
> According to https://emscripten.org/docs/porting/networking.html
> Under title - "Full Proxy Sockets over WebSocket Proxy Server"
> I believe it's telling us how to allows full POSIX Sockets API access
> from a web browser.
> But I am not able to figure out how.
>
> Please help, guidance required.
>
> On Mon, 24 Aug 2020, 04:27 'Sam Clegg' via emscripten-discuss, <
> [email protected]> wrote:
>
>> I believe the websocket_to_posix_proxy is designed to run natively on the
>> server, so you want to build with regular `cmake` and not `emcake`.    It
>> doesn't run in JS or compile with emscripten.
>>
>> On Sun, Aug 23, 2020 at 11:42 AM Harsh chopra <
>> [email protected]> wrote:
>>
>>> Hi,
>>>
>>> I am trying to generate POSIX sockets proxying in "js" ,  use it in
>>> Browser and make it act as a server.
>>>
>>> The program under "tools/websocket_to_posix_proxy/" use CMake which
>>> works perfect when build with "cmake && make" but when I used "emcamke
>>> cmake" , it generate Makefile using "node" as the cross_compiler which is
>>> fine but when I use "emmake make" it wont build because "node" dont support
>>> posix socket.
>>>
>>> So is there any other way things could work?
>>>
>>> ----------CMAKELIST.TXT------------------
>>>
>>>  cmake_minimum_required(VERSION 2.8)
>>> project(websocket_to_posix_proxy)
>>> file(GLOB sourceFiles src/*.cpp src/*.h)
>>> add_executable(websocket_to_posix_proxy ${sourceFiles})
>>> find_package(Threads)
>>> target_link_libraries(websocket_to_posix_proxy ${CMAKE_THREAD_LIBS_INIT})
>>>
>>> if (WIN32)
>>>     add_definitions(-D_CRT_SECURE_NO_WARNINGS)
>>>     add_definitions(/wd4200) # "nonstandard extension used: zero-sized
>>> array in struct/union"
>>>     target_link_libraries(websocket_to_posix_proxy Ws2_32.lib)
>>> endif()
>>>
>>> --
>>> 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/0c766845-db4b-4dd4-b196-4f8d80aa499an%40googlegroups.com
>>> <https://groups.google.com/d/msgid/emscripten-discuss/0c766845-db4b-4dd4-b196-4f8d80aa499an%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
>> 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/CAL_va2-VgQ3JyFJ0r18NqegTfDFpwrnSnq7-jw%2BrUNeBODy68w%40mail.gmail.com
>> <https://groups.google.com/d/msgid/emscripten-discuss/CAL_va2-VgQ3JyFJ0r18NqegTfDFpwrnSnq7-jw%2BrUNeBODy68w%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> 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/CAPEbqj6mJc9Hkkuc%2BTA3x7JLEb-0zYfOd4eacq4G1LD-mnobXA%40mail.gmail.com
> <https://groups.google.com/d/msgid/emscripten-discuss/CAPEbqj6mJc9Hkkuc%2BTA3x7JLEb-0zYfOd4eacq4G1LD-mnobXA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CANLCaynfgMcaF8RT14PTNDQEBoKX%3DNo_b0N1v6cEAPm4LrFqTQ%40mail.gmail.com.

Reply via email to