File tree Expand file tree Collapse file tree 2 files changed +786
-780
lines changed Expand file tree Collapse file tree 2 files changed +786
-780
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,29 @@ var client = new HiveMQClient(options);
47
47
var connectResult = await client .ConnectAsync ().ConfigureAwait (false );
48
48
```
49
49
50
+ ## Using WebSockets
51
+
52
+ ``` csharp
53
+ var options = new HiveMQClientOptionsBuilder ()
54
+ .WithWebSocketServer (" ws://broker.hivemq.com:8000/mqtt" )
55
+ .Build ();
56
+
57
+ var client = new HiveMQClient (options );
58
+ var connectResult = await client .ConnectAsync ().ConfigureAwait (false );
59
+ ```
60
+
61
+ ## Using an IP address
62
+
63
+ Some embedded devices don't have DNS support and can only connect to static IPs. Here's how you can connect:
64
+
65
+ ``` csharp
66
+ var options = new HiveMQClientOptionsBuilder ()
67
+ .WithWebSocketServer (" 127.0.0.1:8000" )
68
+ .Build ();
69
+
70
+ var client = new HiveMQClient (options );
71
+ var connectResult = await client .ConnectAsync ().ConfigureAwait (false );
72
+ ```
50
73
51
74
## See Also
52
75
You can’t perform that action at this time.
0 commit comments