shamblett / mqtt_client

A server and browser based MQTT client for dart
Other
552 stars 179 forks source link

some easy sample of how connect by 8883 port? #164

Closed inforaudio closed 4 years ago

inforaudio commented 4 years ago

Hello: Thanks for your work, is incredible. We try to looking for inside of all samples, and cant find a real example of how connect a function by ssl/tls or 8883 port.

We can connect by no secure mode using 1883 port, but is not possible connect by 8883 port.

Have you got a simple / easy sample? something without using certificate?

Thanks.

shamblett commented 4 years ago

Your not the first to ask this so I've added an example, see the example file mqtt_server_client_secure.dart for an example of connection to the mosquitto test server using port 8883 and secure mode. I'm not sure what you mean by 'something without using certificate', you will almost always need at least a client certificate to use TLS, you don't need to genertae your own though to use this example.

inforaudio commented 4 years ago

Thanks for your answer. Im rookie in flutter, and need time.

About example/iot_core.dart . I try 2 - 3 time to test it, but i cant made run. How is the process?? If i open the example with visual Studio code and run. The error is: " Error: Error when reading 'bin/main.dart': The system cant find the path specific." How i can solved it. ?? The example dont have main.dart file.

If i copy conten of iot_core.dart and put over a clean flutter file. Never find the file roots.pem. ( i try to put in sample place , root, /pem/ .. /example/ etc.. How can solved it?

This data function properly? are correct? mqtt.googleapis.com , 443 and roots.pem file??

shamblett commented 4 years ago

I don't use flutter and I don't use VS code, I use intellij so I can't really help with any of this, the iot-core example is a particularly specialised one for use with GCP and probably not the best to use if your learning(BTW a fuller example of using the client with GCP's MQTT broker is here). Does the example I provided above work OK?