amenzhinsky / iothub

Azure IoT Hub SDK for Golang
MIT License
51 stars 57 forks source link

Allow websocket protocol #17

Closed moqmar closed 4 years ago

moqmar commented 4 years ago

To use websockets, I successfully changed the following line manually according to according to https://github.com/MicrosoftDocs/azure-docs/issues/21306: https://github.com/amenzhinsky/iothub/blob/e12c1ec06eddab5a2534169d1a8d654deaa6039f/iotdevice/transport/mqtt/mqtt.go#L107

o.AddBroker("wss://" + creds.GetHostName() + ":443/$iothub/websocket")

I think this should be possible to do through an option though, as in some cases it's e.g. impossible to use outgoing port 8883.