You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guides/laravel.md
+11-17Lines changed: 11 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ Why choosing AnyCable over Reverb et al?
6
6
7
7
AnyCable is a battle-proofed real-time server that's been in production at scale for many years. It comes with extensive features set (reliability, various protocols support, observability tools, etc.) and it's **free to use**.
8
8
9
-
You can use AnyCable server in a [Pusher mode](/anycable-go/pusher.md) or _natively_ using a custom broadcasting and Echo adapter. In the latter, you can benefit from such AnyCable features as streams history and resumable sessions (see [Reliable streams](/anycable-go/reliable_streams.md)).
9
+
You can use AnyCable server in a [Pusher mode](/anycable-go/pusher.md) or _natively_ using a custom broadcasting and Echo adapter. In the latter, you can benefit from such AnyCable features as streams history and resumeable sessions (see [Reliable streams](/anycable-go/reliable_streams.md)).
10
10
11
11
## Pusher mode
12
12
@@ -40,8 +40,6 @@ When running with this command, AnyCable automatically recognizes the following
40
40
41
41
## AnyCable mode
42
42
43
-
**IMPORTANT:** This feature is currently in progress. Coming soon!
44
-
45
43
> Check out our demo Laravel application to see the complete example: [laravel-anycable-demo][]
46
44
47
45
To fully benefit from AnyCable features, we recommend switching to use our [client library][anycable-client]. We also provide an Echo adapter that provides a familiar interface while using AnyCable JS SDK under the hood.
@@ -77,24 +75,17 @@ Now, install the `@anycable/echo` JS package and configure your Echo instance:
77
75
78
76
```js
79
77
importEchofrom"laravel-echo";
80
-
import { createCable } from"@anycable/web";
81
-
importEchoCablefrom"@anycable/echo";
82
-
83
-
// Example options
84
-
constcableOptions= {
85
-
protocol:"actioncable-v1-ext-json"// supports stream history and presence
By default, AnyCable client looks up a WebSocket server URL from the `<meta name="cable-url">` tag on the page.
96
-
You can also specify it explicitly in the options.
97
-
98
89
Finally, install AnyCable server. We provide a convenient Artisan command that automatically downloads (when necessary) and runs the server:
99
90
100
91
```sh
@@ -104,7 +95,8 @@ php artisan anycable:server
104
95
You can specify AnyCable configuration in the `.env` file:
105
96
106
97
-`ANYCABLE_SECRET=secret`
107
-
-`ANYCABLE_PUBLIC_STREAMS=true` (to enable public channels—they're disable by default)
98
+
-`ANYCABLE_PUBLIC=true`: This MUST be set to true to allow connection (however, we highly recommend looking at the [JWT Authentication feature](/anycable-go/jwt_identification.md)).
99
+
-`ANYCABLE_PUBLIC_STREAMS=true`: Enables public channels—they're disabled by default.
108
100
109
101
You can also create an `anycable.toml` configuration file to fine-tune your AnyCable server (see [docs](/anycable-go/configuration?id=configuration-files)).
110
102
@@ -116,8 +108,10 @@ That's it! Run your Laravel application, launch AnyCable server, and you should
116
108
117
109
## Benchmarks
118
110
119
-
TBD
111
+
You can find the benchmarks here: https://github.com/anycable/anycable-laravel/tree/master/benchmarks
112
+
113
+
_tl;dr AnyCable shows slightly better performance and lesser memory usage during broadcast benchmarks compared to Reverb; however, AnyCable handles connection avalanches much better_
0 commit comments