oatpp / oatpp-websocket

oatpp-websocket submodule.
https://oatpp.io/
Apache License 2.0
78 stars 32 forks source link

Example of websocket usage? #1

Closed cgrantcal closed 5 years ago

cgrantcal commented 5 years ago

Hey,

Im wondering if you have an example piece of code to integrate the websocket into oatpp with swagger.

Thanks

Conor

lganzzzo commented 5 years ago

Hey @cgrantcal

I have created a simple websocket server example for you https://github.com/lganzzzo/oatpp-example-websocket.

There you can learn how to work with oatpp-websocket.


In your project CMake add:

find_package(oatpp-websocket    0.19.1 REQUIRED)
...
target_link_libraries(your-target
        ...
        PUBLIC oatpp::oatpp-websocket
)

About swagger-ui itself - I'am not sure if swagger UI supports websocket-API. You may use http://www.websocket.org/echo.html to test your websocket server.
Make sure to use http version instead of https (otherwise you need to add https support to your server also).

In location field put ws://localhost:8000/websocket-connect - to connect to your server.

Let me know if you have questions.

Best Regards, Leonid