Skip to content

Commit b45d786

Browse files
committed
Merge branch '2.x' of github.com:beyondcode/laravel-websockets into fix/app-connections-count
2 parents 7e9d3cd + 06c898a commit b45d786

File tree

4 files changed

+20
-28
lines changed

4 files changed

+20
-28
lines changed

docs/basic-usage/ssl.md

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -270,28 +270,20 @@ You know you've reached this limit of your Nginx error logs contain similar mess
270270

271271
Remember to restart your Nginx after you've modified the `worker_connections`.
272272

273-
### Example using Caddy
273+
### Example using Caddy v2
274274

275-
[Caddy](https://caddyserver.com) can also be used to automatically obtain a TLS certificate from Let's Encrypt and terminate TLS before proxying to your echo server.
275+
[Caddy](https://caddyserver.com) can also be used to automatically obtain a TLS certificate from Let's Encrypt and terminate TLS before proxying to your websocket server.
276276

277277
An example configuration would look like this:
278278

279279
```
280280
socket.yourapp.tld {
281-
rewrite / {
282-
if {>Connection} has Upgrade
283-
if {>Upgrade} is websocket
284-
to /websocket-proxy/{path}?{query}
281+
@ws {
282+
header Connection *Upgrade*
283+
header Upgrade websocket
285284
}
286-
287-
proxy /websocket-proxy 127.0.0.1:6001 {
288-
without /special-websocket-url
289-
transparent
290-
websocket
291-
}
292-
293-
tls youremail.com
285+
reverse_proxy @ws 127.0.0.1:6001
294286
}
295287
```
296288

297-
Note the `to /websocket-proxy`, this is a dummy path to allow the `proxy` directive to only proxy on websocket connections. This should be a path that will never be used by your application's routing. Also, note that you should change `127.0.0.1` to the hostname of your websocket server. For example, if you're running in a Docker environment, this might be the container name of your websocket server.
289+
Note that you should change `127.0.0.1` to the hostname of your websocket server. For example, if you're running in a Docker environment, this might be the container name of your websocket server.

src/Apps/App.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class App
88
{
9-
/** @var int */
9+
/** @var string|int */
1010
public $id;
1111

1212
/** @var string */
@@ -39,7 +39,7 @@ class App
3939
/**
4040
* Find the app by id.
4141
*
42-
* @param mixed $appId
42+
* @param string|int $appId
4343
* @return \BeyondCode\LaravelWebSockets\Apps\App|null
4444
*/
4545
public static function findById($appId)
@@ -50,7 +50,7 @@ public static function findById($appId)
5050
/**
5151
* Find the app by app key.
5252
*
53-
* @param mixed $appId
53+
* @param string $appKey
5454
* @return \BeyondCode\LaravelWebSockets\Apps\App|null
5555
*/
5656
public static function findByKey($appKey): ?self
@@ -61,7 +61,7 @@ public static function findByKey($appKey): ?self
6161
/**
6262
* Find the app by app secret.
6363
*
64-
* @param mixed $appId
64+
* @param string $appSecret
6565
* @return \BeyondCode\LaravelWebSockets\Apps\App|null
6666
*/
6767
public static function findBySecret($appSecret): ?self
@@ -72,9 +72,9 @@ public static function findBySecret($appSecret): ?self
7272
/**
7373
* Initialize the Web Socket app instance.
7474
*
75-
* @param mixed $appId
76-
* @param mixed $key
77-
* @param mixed $secret
75+
* @param string|int $appId
76+
* @param string $key
77+
* @param string $secret
7878
* @return void
7979
* @throws \BeyondCode\LaravelWebSockets\Exceptions\InvalidApp
8080
*/

src/Apps/AppManager.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,23 @@ public function all(): array;
1414
/**
1515
* Get app by id.
1616
*
17-
* @param mixed $appId
17+
* @param string|int $appId
1818
* @return \BeyondCode\LaravelWebSockets\Apps\App|null
1919
*/
2020
public function findById($appId): ?App;
2121

2222
/**
2323
* Get app by app key.
2424
*
25-
* @param mixed $appKey
25+
* @param string $appKey
2626
* @return \BeyondCode\LaravelWebSockets\Apps\App|null
2727
*/
2828
public function findByKey($appKey): ?App;
2929

3030
/**
3131
* Get app by secret.
3232
*
33-
* @param mixed $appSecret
33+
* @param string $appSecret
3434
* @return \BeyondCode\LaravelWebSockets\Apps\App|null
3535
*/
3636
public function findBySecret($appSecret): ?App;

src/Apps/ConfigAppManager.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function all(): array
3838
/**
3939
* Get app by id.
4040
*
41-
* @param mixed $appId
41+
* @param string|int $appId
4242
* @return \BeyondCode\LaravelWebSockets\Apps\App|null
4343
*/
4444
public function findById($appId): ?App
@@ -53,7 +53,7 @@ public function findById($appId): ?App
5353
/**
5454
* Get app by app key.
5555
*
56-
* @param mixed $appKey
56+
* @param string $appKey
5757
* @return \BeyondCode\LaravelWebSockets\Apps\App|null
5858
*/
5959
public function findByKey($appKey): ?App
@@ -68,7 +68,7 @@ public function findByKey($appKey): ?App
6868
/**
6969
* Get app by secret.
7070
*
71-
* @param mixed $appSecret
71+
* @param string $appSecret
7272
* @return \BeyondCode\LaravelWebSockets\Apps\App|null
7373
*/
7474
public function findBySecret($appSecret): ?App

0 commit comments

Comments
 (0)