Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebSocket server implementation? #358

Closed
garethsb-ghost opened this issue Feb 14, 2017 · 18 comments
Closed

WebSocket server implementation? #358

garethsb-ghost opened this issue Feb 14, 2017 · 18 comments

Comments

@garethsb-ghost
Copy link

I had been hoping to find a websocket server implementation to use alongside http_listener. Have I missed it, is it in the roadmap, or do you have any pointers on doing it myself (I'm currently looking at mashing something up wrapping websocketpp::server)?

Thanks!

@Ban44n
Copy link

Ban44n commented Apr 23, 2017

+1

1 similar comment
@gdelab
Copy link

gdelab commented Oct 17, 2017

+1

@garethsb
Copy link
Contributor

garethsb commented Oct 17, 2017

Please see if the interface at https://github.com/sony/nmos-cpp/blob/master/Development/cpprest/ws_listener.h and implementation at https://github.com/sony/nmos-cpp/blob/master/Development/cpprest/ws_listener_impl.cpp is of interest. It may not be complete enough for cpprestsdk yet, but feedback is welcome.

@sinall
Copy link

sinall commented Oct 21, 2017

@garethsb-sony do you plan to send a pull request to cpprestsdk? It will help a lot of people.

@garethsb
Copy link
Contributor

Yes. Sorry, it will take us a little while to prepare to do it, but any feedback is welcome.

@hdiethelm
Copy link

+1 for this!
I implemented the function set_message_handler(), so the server can also handle incoming messages:
ws.diff.txt

@nathanprins
Copy link

@garethsb-sony are you still intending on sending a pr? It has been some time since your previous comment.

@garethsb
Copy link
Contributor

garethsb commented Jul 8, 2019

@nathanprins There seems little interest from the Microsoft maintainers in adding new functionality, and I think it unlikely a PR would be accepted without a test suite in the C++ REST SDK style. However, my implementation is in active use on several projects and is now reasonably feature complete. See interface at https://github.com/sony/nmos-cpp/blob/master/Development/cpprest/ws_listener.h and implementation at https://github.com/sony/nmos-cpp/blob/master/Development/cpprest/ws_listener_impl.cpp.

@nathanprins
Copy link

Alright, I'll take a closer look at your repo. Thanks!

@garethsb
Copy link
Contributor

@nathanprins - recently updated to enable richer user validation on connection, e.g. to check "Authorization" header when doing Secure WebSocket.

@jbbcst
Copy link

jbbcst commented Jun 13, 2022

Hi all,

I am testing ccprestsdk on a Linux system, i am using the handler.cpp file (as in the sample Restweb available in Documentations/Samples). I can respond to the different HTTP requests (GET, POST...), my question is about WebSocket server side, is it possible to add it at the same level of the handle.cpp file? I have already implemented the HTTP request processing in the handler.cpp and I wonder if I can manage the websocket in the same file, at the same level?

Thanks in advance

@garethsb
Copy link
Contributor

The nmos-cpp websocket_listener server is functional and works in same style as cpprestsdk, but must be opened on a different port than an http_listener.

@jbbcst
Copy link

jbbcst commented Jun 13, 2022

Thank you for your answer, you mean that I have to open an http_listener for my current http request processing and on another port launch the nmos-cpp websocket_listener to handle Websocket connections?

@garethsb
Copy link
Contributor

Yes, that's it.

@jbbcst
Copy link

jbbcst commented Jun 14, 2022

Ok thanks, is there an example of using websockets processing with nmos? I looked in the documentation but did not find

@garethsb
Copy link
Contributor

The websocket_listener is used in nmos-cpp itself but there isn't currently a standalone example just showing how to use it/alongside http_listener. That would be nice for sure...

@jbbcst
Copy link

jbbcst commented Jun 14, 2022

Thank you for your help, I'll take a closer look

@barcharcraz
Copy link
Member

This is not on the roadmap, and we don't intend to support new server types

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants