gmag11 / MQTT-MQL5-Library

MQTT client library for MetaTrader 5
MIT License
3 stars 2 forks source link

Connection failure with Mosquitto #1

Closed shimatai closed 6 months ago

shimatai commented 8 months ago

Which MQTT server did you use to run the example?

I'm trying to run this example using Mosquitto on its latest version. Mosquitto also supports MQTT versions 3.1 and 3.1.1

I added my Mosquitto server address on the Expert Advisors allowed URLs for WebRequest and I'm still getting connection failure.

EnziinSystem commented 7 months ago

EA on MT5 enables only port 80/443.

So you need to change the port in the example to 80 or 443

MQTT server also listens on port 80 or 443.

Change the port on the server from 1883/8883 to 80/443

sudo systemctl stop mosquitto

sudo apt-get install redir

sudo redir :80 :1883

sudo systemctl start mosquitto

Screenshot 2024-02-18 211207 Screenshot 2024-02-18 211241

gmag11 commented 6 months ago

Actually I did use standard 8883 port for SSL and 1883 for plain MQTT. You need to set the port permission in MT5 like xxx.xxx.xxx.xxx:1883

I used a local Mosquito Docker instance