From 825b5c2eba9c2c39d577865d9a7125fc70f25641 Mon Sep 17 00:00:00 2001 From: Reid Ivens Date: Mon, 2 Jun 2025 20:15:21 -0400 Subject: [PATCH 1/6] Added a wsPath option --- lib/src/options.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/src/options.dart b/lib/src/options.dart index 7934b87..5c2a096 100644 --- a/lib/src/options.dart +++ b/lib/src/options.dart @@ -22,6 +22,9 @@ class PusherOptions { /// The wss port of the connection (default: 443). final int wssPort; + /// The path portion of the connection (default: /app/). + final String wsPath; + /// Enable encryption for the connection. final bool encrypted; @@ -64,6 +67,7 @@ class PusherOptions { this.host, this.wsPort = 80, this.wssPort = 443, + this.wsPath = '/app/', this.encrypted = true, this.activityTimeout = 120000, this.pongTimeout = 30000, @@ -104,7 +108,7 @@ class PusherOptions { ...parameters, if (hostUri?.query.isNotEmpty == true) ...hostUri!.queryParameters, }, - path: '/app/$key', + path: '${wsPath}${key}', ); } From 09690feaa359e7456c61d9bc7bfb0567bc023136 Mon Sep 17 00:00:00 2001 From: Reid Ivens Date: Mon, 2 Jun 2025 20:24:14 -0400 Subject: [PATCH 2/6] Incremented version number --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index bdf6783..57145e2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: pusher_client_socket description: "The pusher client using websocket client [available for all platforms]" -version: 0.0.5 +version: 0.0.6 homepage: https://github.com/AbdoPrDZ/pusher_client_socket environment: From 52f1ad66d2c14eff862152492b221e4c37e0032f Mon Sep 17 00:00:00 2001 From: Reid Ivens Date: Mon, 2 Jun 2025 20:25:44 -0400 Subject: [PATCH 3/6] Updated the docs to include wsPath example & description --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9129d94..e94be96 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,8 @@ import 'package:pusher_client_socket/channels/presence_channel.dart'; key: 'REVERB_APP_KEY', host: 'localhost', // REVERB_HOST wsPort: 6001, // REVERB_PORT - encrypted: false, // (Note: enable it if you'r using wss connection) + wpPath: '/app/', + encrypted: false, // (Note: enable it if you're using wss connection) authOptions: PusherAuthOptions( endpoint: 'http://localhost/broadcasting/auth', headers: { @@ -157,12 +158,13 @@ channel.unsubscribe(); ## Pusher Client Options | Option | Type | Description | -| ------------------------- | ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | +|---------------------------|-------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------| | `key` | `String` | The Pusher app key used to authenticate the connection. This is a required parameter. | | `cluster` | `String?` | The cluster of the Pusher server. If provided, it is used to construct the default WebSocket host. | | `host` | `String?` | The custom host for the connection. If not provided, it defaults to the Pusher WebSocket host based on the cluster. | | `wsPort` | `int` | The ws port of the connection (default: 80). | | `wssPort` | `int` | The wss port of the connection (default: 443). | +| `wsPath` | `String` | The path portion of the connection url (default: /app/). | | `encrypted` | `bool` | A flag indicating whether to enable encrypted connection. Default is `false`. | | `activityTimeout` | `int` | The activity timeout in milliseconds. This is the duration after which a ping is sent if no activity is detected. Default is 120000 (2 minutes). | | `pongTimeout` | `int` | The timeout in milliseconds for waiting for a pong response after a ping is sent. Default is 30000 (30 seconds). | From 6f7703413e084e627a9252b37660673e2ee6b7b3 Mon Sep 17 00:00:00 2001 From: Reid Ivens Date: Mon, 2 Jun 2025 20:41:39 -0400 Subject: [PATCH 4/6] Changed the default from /app/ to just /app --- README.md | 4 ++-- lib/src/options.dart | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e94be96..bf5eecc 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ import 'package:pusher_client_socket/channels/presence_channel.dart'; key: 'REVERB_APP_KEY', host: 'localhost', // REVERB_HOST wsPort: 6001, // REVERB_PORT - wpPath: '/app/', + wpPath: '/app', encrypted: false, // (Note: enable it if you're using wss connection) authOptions: PusherAuthOptions( endpoint: 'http://localhost/broadcasting/auth', @@ -164,7 +164,7 @@ channel.unsubscribe(); | `host` | `String?` | The custom host for the connection. If not provided, it defaults to the Pusher WebSocket host based on the cluster. | | `wsPort` | `int` | The ws port of the connection (default: 80). | | `wssPort` | `int` | The wss port of the connection (default: 443). | -| `wsPath` | `String` | The path portion of the connection url (default: /app/). | +| `wsPath` | `String` | The path portion of the connection url (default: /app). | | `encrypted` | `bool` | A flag indicating whether to enable encrypted connection. Default is `false`. | | `activityTimeout` | `int` | The activity timeout in milliseconds. This is the duration after which a ping is sent if no activity is detected. Default is 120000 (2 minutes). | | `pongTimeout` | `int` | The timeout in milliseconds for waiting for a pong response after a ping is sent. Default is 30000 (30 seconds). | diff --git a/lib/src/options.dart b/lib/src/options.dart index 5c2a096..35c72ef 100644 --- a/lib/src/options.dart +++ b/lib/src/options.dart @@ -67,7 +67,7 @@ class PusherOptions { this.host, this.wsPort = 80, this.wssPort = 443, - this.wsPath = '/app/', + this.wsPath = '/app', this.encrypted = true, this.activityTimeout = 120000, this.pongTimeout = 30000, @@ -108,7 +108,7 @@ class PusherOptions { ...parameters, if (hostUri?.query.isNotEmpty == true) ...hostUri!.queryParameters, }, - path: '${wsPath}${key}', + path: '${wsPath}/${key}', ); } From cd549389f10d648d4114304bfafa96a25364352f Mon Sep 17 00:00:00 2001 From: Reid Ivens Date: Mon, 2 Jun 2025 21:02:30 -0400 Subject: [PATCH 5/6] Typo in wsPath example --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bf5eecc..7ca0a36 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ import 'package:pusher_client_socket/channels/presence_channel.dart'; key: 'REVERB_APP_KEY', host: 'localhost', // REVERB_HOST wsPort: 6001, // REVERB_PORT - wpPath: '/app', + wsPath: '/app', encrypted: false, // (Note: enable it if you're using wss connection) authOptions: PusherAuthOptions( endpoint: 'http://localhost/broadcasting/auth', From 00cc0a0ca59a1bdad474e387c8ac14f01b176ae0 Mon Sep 17 00:00:00 2001 From: Reid Ivens Date: Mon, 2 Jun 2025 21:03:16 -0400 Subject: [PATCH 6/6] Updated default example in wsPath comment --- lib/src/options.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/options.dart b/lib/src/options.dart index 35c72ef..1c334a4 100644 --- a/lib/src/options.dart +++ b/lib/src/options.dart @@ -22,7 +22,7 @@ class PusherOptions { /// The wss port of the connection (default: 443). final int wssPort; - /// The path portion of the connection (default: /app/). + /// The path portion of the connection (default: /app). final String wsPath; /// Enable encryption for the connection.