3

So I have my paho client behind a ccproxy server with sock enabled.

The problem is in paho python lib there is a method exposed for setting proxy

client.proxy_set(proxy_type=socks.HTTP, proxy_addr="192.168.1.7", proxy_port=808)

Can someone guide me on the proxy setup for the same on cpp couldn't find much documentation in the docs or the community.

Daniel Euchar
  • 1,740
  • 5
  • 28
  • 45

2 Answers2

0

Paho Client for C++ does not seem to support proxies yet, see also this issue

der_ambi
  • 26
  • 3
  • Even C is not supporting I believe, in the above link the second comment is mine. reaching out to community if anyone has implemented it. – Daniel Euchar Nov 17 '20 at 07:35
  • Paho Client for C++ seems to be a wrapper around the Paho Client for C. That one has support for HTTP Proxies, see https://github.com/eclipse/paho.mqtt.c/blob/b3da4d6456550f3e48cf131e4f8017e964ad33fa/src/MQTTProtocolOut.c#L162 So using the http_proxy environment variable should trigger this. Howevery, this is still no support for SOCKS. – der_ambi Nov 18 '20 at 11:04
0

Assuming you are running the code on Linux.

Have you tried running the compiled application with the socksify command?

This inserts a shim into the library that handles socket creation and wraps them in a connection to the Socks proxy (It looks like it may support HTTP Connect based proxying as well).

hardillb
  • 54,545
  • 11
  • 67
  • 105
  • I'm on windows I did use proxifier to scoksify and it works but I need something built within my app – Daniel Euchar Nov 17 '20 at 11:07
  • I've not played with pre-loading libraries on Windows but you should be able to do some tricks that sockify is doing at runtime with linking to get the same effect baked into the app. – hardillb Nov 17 '20 at 11:10