File tree Expand file tree Collapse file tree 5 files changed +11
-3
lines changed Expand file tree Collapse file tree 5 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 1
1
import { Stream , Readable } from 'stream' ;
2
+ import * as http from 'http' ;
2
3
import * as FormData from 'form-data' ;
4
+ import * as WebSocket from 'ws' ;
3
5
import {
4
6
FireFlyStatusResponse ,
5
7
FireFlyPrivateSendOptions ,
@@ -549,6 +551,7 @@ export default class FireFly extends HttpBase {
549
551
listen (
550
552
subscriptions : string | string [ ] | FireFlySubscriptionBase ,
551
553
callback : FireFlyWebSocketCallback ,
554
+ socketOptions ?: WebSocket . ClientOptions | http . ClientRequestArgs ,
552
555
) : FireFlyWebSocket {
553
556
const options : FireFlyWebSocketOptions = {
554
557
host : this . options . websocket . host ,
@@ -559,6 +562,7 @@ export default class FireFly extends HttpBase {
559
562
autoack : false ,
560
563
reconnectDelay : this . options . websocket . reconnectDelay ,
561
564
heartbeatInterval : this . options . websocket . heartbeatInterval ,
565
+ socketOptions : socketOptions ,
562
566
} ;
563
567
564
568
const handler : FireFlyWebSocketCallback = ( socket , event ) => {
Original file line number Diff line number Diff line change
1
+ import * as http from 'http' ;
1
2
import { AxiosRequestConfig } from 'axios' ;
3
+ import * as WebSocket from 'ws' ;
2
4
import { operations } from './schema' ;
3
5
4
6
/**
@@ -61,6 +63,7 @@ export interface FireFlyWebSocketOptions {
61
63
autoack : boolean ;
62
64
reconnectDelay : number ;
63
65
heartbeatInterval : number ;
66
+ socketOptions ?: WebSocket . ClientOptions | http . ClientRequestArgs ;
64
67
}
65
68
66
69
// Namespace
Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ export class FireFlyWebSocket {
57
57
? `${ this . options . username } :${ this . options . password } `
58
58
: undefined ;
59
59
const socket = ( this . socket = new WebSocket ( url , {
60
+ ...this . options . socketOptions ,
60
61
auth,
61
62
handshakeTimeout : this . options . heartbeatInterval ,
62
63
} ) ) ;
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @hyperledger/firefly-sdk" ,
3
- "version" : " 1.2.3 " ,
3
+ "version" : " 1.2.4 " ,
4
4
"description" : " Client SDK for Hyperledger FireFly" ,
5
5
"main" : " dist/index.js" ,
6
6
"types" : " dist/index.d.ts" ,
You can’t perform that action at this time.
0 commit comments