websocket icon indicating copy to clipboard operation
websocket copied to clipboard

Addition of options to allow loading of custom certificates

Open dcam0050 opened this issue 4 years ago • 1 comments

Addition of an Options field of type map[string]interface{} to DialOptions which is used in the constructor for the js websocket instance and enables passing custom options like custom certificates.

dcam0050 avatar Jan 12 '21 00:01 dcam0050

After further investigation it seems like this is an option that is only available when using NodeJS as the javascript interpreter. This is the npm package in was using: https://www.npmjs.com/package/ws

The browser api for Websocket on the other hand does not allow for the use of custom certificates at all. That said though, when running this change with Vanillajs, there was no side effect except for lack of feedback saying that Options were ignored.

dcam0050 avatar Jan 17 '21 00:01 dcam0050

I think this is better solved by #373 then as you could override the transport and not use the browser API as the library assumes by default to pass whatever options you want.

nhooyr avatar Mar 07 '23 15:03 nhooyr