ws broacast_server / can set serving hostname

This commit is contained in:
Benjamin Sergeant
2019-03-10 16:36:44 -07:00
parent e46eb8aa49
commit 03abe77b5f
5 changed files with 14 additions and 7 deletions

View File

@ -10,11 +10,11 @@
namespace ix
{
int ws_broadcast_server_main(int port)
int ws_broadcast_server_main(int port, const std::string& hostname)
{
std::cout << "Listening on port " << port << std::endl;
std::cout << "Listening on " << hostname << ":" << port << std::endl;
ix::WebSocketServer server(port);
ix::WebSocketServer server(port, hostname);
server.setOnConnectionCallback(
[&server](std::shared_ptr<ix::WebSocket> webSocket)