Skip to content

Commit e35f2bf

Browse files
authored
Documentation Updates: Bundle upgrades & WebSockets (#194)
1 parent 3025cbf commit e35f2bf

File tree

2 files changed

+786
-780
lines changed

2 files changed

+786
-780
lines changed

Documentation/docs/connecting.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,29 @@ var client = new HiveMQClient(options);
4747
var connectResult = await client.ConnectAsync().ConfigureAwait(false);
4848
```
4949

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+
```
5073

5174
## See Also
5275

0 commit comments

Comments
 (0)