Skip to content

Commit

Permalink
version: 4.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
diva-exchange committed Jul 13, 2022
1 parent 4fe7565 commit df22389
Show file tree
Hide file tree
Showing 6 changed files with 149 additions and 144 deletions.
1 change: 1 addition & 0 deletions dist/config.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
declare type tSession = {
id?: string;
options?: string;
};
declare type tStream = {
destination: string;
Expand Down
1 change: 1 addition & 0 deletions dist/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const DEFAULT_LENGTH_SESSION = 16;
const DEFAULT_CONFIGURATION = {
session: {
id: '',
options: '',
},
stream: {
destination: '',
Expand Down
2 changes: 2 additions & 0 deletions dist/i2p-sam.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node" />
import { EventEmitter } from 'events';
import { Config, Configuration } from './config';
import { Socket } from 'net';
Expand Down
5 changes: 3 additions & 2 deletions dist/i2p-sam.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,17 @@ class I2pSam extends events_1.EventEmitter {
let s = `SESSION CREATE ID=${this.config.session.id} DESTINATION=${this.privateKey} `;
switch (type) {
case 'STREAM':
s += 'STYLE=STREAM\n';
s += 'STYLE=STREAM';
break;
case 'DATAGRAM':
case 'RAW':
s += `STYLE=${type} PORT=${this.config.listen.portForward} HOST=${this.config.listen.hostForward}\n`;
s += `STYLE=${type} PORT=${this.config.listen.portForward} HOST=${this.config.listen.hostForward}`;
break;
}
this.internalEventEmitter.removeAllListeners();
this.internalEventEmitter.once('error', reject);
this.internalEventEmitter.once('session', resolve);
s += (this.config.session.options ? ' ' + this.config.session.options : '') + '\n';
this.socketControl.write(s, (error) => {
error && reject(error);
});
Expand Down
Loading

0 comments on commit df22389

Please sign in to comment.