Example of websocket usage?
cgrantcal opened this issue · comments
Hey,
Im wondering if you have an example piece of code to integrate the websocket into oatpp with swagger.
Thanks
Conor
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