Skip to content

Commit bab4e35

Browse files
Merge pull request #2168 from hwasurr/master
docs(websockets): fix invalid links
2 parents 6e0edb2 + 3149dc0 commit bab4e35

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

content/websockets/gateways.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ $ npm i --save @nestjs/websockets @nestjs/platform-socket.io
2121

2222
#### Overview
2323

24-
In general, each gateway is listening on the same port as the **HTTP server**, unless your app is not a web application, or you have changed the port manually. This default behavior can be modified by passing an argument to the `@WebSocketGateway(80)` decorator where `80` is a chosen port number. You can also set a [namespace](https://socket.io/docs/rooms-and-namespaces/) used by the gateway using the following construction:
24+
In general, each gateway is listening on the same port as the **HTTP server**, unless your app is not a web application, or you have changed the port manually. This default behavior can be modified by passing an argument to the `@WebSocketGateway(80)` decorator where `80` is a chosen port number. You can also set a [namespace](https://socket.io/docs/v4/namespaces/) used by the gateway using the following construction:
2525

2626
```typescript
2727
@WebSocketGateway(80, { namespace: 'events' })
@@ -99,7 +99,7 @@ handleEvent(client, data) {
9999
}
100100
```
101101

102-
In the example above, the `handleEvent()` function takes two arguments. The first one is a platform-specific [socket instance](https://socket.io/docs/server-api/#socket), while the second one is the data received from the client. This approach is not recommended though, because it requires mocking the `socket` instance in each unit test.
102+
In the example above, the `handleEvent()` function takes two arguments. The first one is a platform-specific [socket instance](https://socket.io/docs/v4/server-api/#socket), while the second one is the data received from the client. This approach is not recommended though, because it requires mocking the `socket` instance in each unit test.
103103

104104
Once the `events` message is received, the handler sends an acknowledgment with the same data that was sent over the network. In addition, it's possible to emit messages using a library-specific approach, for example, by making use of `client.emit()` method. In order to access a connected socket instance, use `@ConnectedSocket()` decorator.
105105

0 commit comments

Comments
 (0)