Handle websocketpp connection path

1.3k Views Asked by At

I'm really newbie in websocketpp. Can you tell me please, how can i get websocket connection path on new connection in my server? I mean i need to get the part of this:

ws://localhost:8080/addr1    ------> get addr1
ws://localhost:8080/addr2    ------> get addr2
ws://localhost:8080/etc      ------> get etc

I'm using now an example from this link: http://www.zaphoyd.com/websocketpp/manual/common-patterns/storing-connection-specificsession-information

1

There are 1 best solutions below

0
On BEST ANSWER

Well, i found soultion by myself :) You should use following code for that purpose:

server::connection_ptr con = s.get_con_from_hdl(hdl);
std::string path = con->get_resource();