I am trying to send socket requests in C++ to an onion link I am hosting with tor services and node.js. My node.js server is being hosted on port
When I try to send socket requests to
localhost:8080, it works perfectly fine.
However, when I try to send them to my onion link, it does not work.
The library I am using to handle sockets is https://github.com/socketio/socket.io-client-cpp.
The C++ code:
sio::client h; connection_listener l(h); h.set_open_listener(std::bind(&connection_listener::on_connected, &l)); h.set_close_listener(std::bind(&connection_listener::on_close, &l,std::placeholders::_1)); h.set_fail_listener(std::bind(&connection_listener::on_fail, &l)); h.connect("http://myonionlink.onion:8080/"); // it fails to connect to the onion link, but works perfectly fine with http://localhost:8080/
Why is this not working for the onion link? Do onion links work differently in this case?
Is there any method I can use to achieve this?