Skip to content

Commit

Permalink
Added: config.stream.timeoutConnect (default 60 seconds)
Browse files Browse the repository at this point in the history
Changed: UDP/datagrams - removed transport compression (introduced in 5.1 - reverted)
Changed: createStream respects timeout
Fixed: tests, docs, code/docker clean-up

Signed-off-by: diva.exchange <[email protected]>
  • Loading branch information
diva-exchange committed Aug 4, 2023
1 parent 1acd67b commit f2ea162
Show file tree
Hide file tree
Showing 22 changed files with 447 additions and 441 deletions.
2 changes: 1 addition & 1 deletion .c8rc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
"text-summary",
"html"
],
"report-dir": "./coverage"
"report-dir": "./test/coverage"
}
3 changes: 1 addition & 2 deletions .mocharc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
"reporter": "list",
"extensions": ["js"],
"spec": ["test/compiled-lib/**/*.spec.js"],
"exit": true,
"bail": false
"exit": true
}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ type tSession = {
type tStream = {
destination: string;
timeout: number;
};
type tForward = {
Expand Down Expand Up @@ -387,6 +388,7 @@ const DEFAULT_CONFIGURATION: ConfigurationDefault = {
},
stream: {
destination: '',
timeout: 60,
},
forward: {
host: '',
Expand Down
3 changes: 3 additions & 0 deletions lib/config.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
export declare const MIN_UDP_MESSAGE_LENGTH: number;
export declare const MAX_UDP_MESSAGE_LENGTH: number;
type tSession = {
id?: string;
options?: string;
};
type tStream = {
destination: string;
timeout?: number;
};
type tForward = {
host: string;
Expand Down
3 changes: 3 additions & 0 deletions lib/config.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/i2p-sam-raw.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ export declare class I2pSamRaw extends I2pSam {
close(): void;
protected initSession(type?: string): Promise<I2pSamRaw>;
send(destination: string, msg: Buffer): void;
private s;
}
49 changes: 23 additions & 26 deletions lib/i2p-sam-raw.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/i2p-sam-stream.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export declare class I2pSamStream extends I2pSam {
private hostForward;
private portForward;
private hasStream;
private timeout;
static createStream(c: Configuration): Promise<I2pSamStream>;
static createForward(c: Configuration): Promise<I2pSamStream>;
static make(c: Configuration): Promise<I2pSamStream>;
Expand Down
29 changes: 19 additions & 10 deletions lib/i2p-sam-stream.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions lib/i2p-sam.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ export declare class I2pSam extends EventEmitter {
private privateKey;
protected internalEventEmitter: EventEmitter;
protected constructor(c: Configuration);
protected open(): Promise<any>;
protected open(): Promise<I2pSam>;
protected close(): void;
protected hello(socket: Socket): Promise<void>;
protected initSession(type: string): Promise<any>;
protected initSession(type: string): Promise<I2pSam>;
protected parseReply(data: Buffer): boolean | undefined;
private static parseReplyKeyValue;
private generateDestination;
Expand Down
18 changes: 11 additions & 7 deletions lib/i2p-sam.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f2ea162

Please sign in to comment.