File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,23 @@ export abstract class AbstractLiveClient extends AbstractClient {
119
119
return ;
120
120
}
121
121
122
+ /**
123
+ * @summary Bun websocket transport has a bug where it's native WebSocket implementation messes up the headers
124
+ * @summary This is a workaround to use the WS package for the websocket connection instead of the native Bun WebSocket
125
+ * @summary you can track the issue here
126
+ * @link https://github.com/oven-sh/bun/issues/4529
127
+ */
128
+ if ( process ?. versions ?. bun ) {
129
+ import ( "ws" ) . then ( ( { default : WS } ) => {
130
+ this . conn = new WS ( requestUrl , {
131
+ headers : this . headers ,
132
+ } ) ;
133
+ console . log ( `Using WS package` ) ;
134
+ this . setupConnection ( ) ;
135
+ } ) ;
136
+ return ;
137
+ }
138
+
122
139
/**
123
140
* Native websocket transport (browser)
124
141
*/
You can’t perform that action at this time.
0 commit comments