File tree 2 files changed +10
-6
lines changed
2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -18,13 +18,15 @@ class Client extends EventEmitter {
18
18
this . config = Object . assign (
19
19
{
20
20
https : {
21
+ ip : "127.0.0.1" ,
22
+ port : 17091 ,
21
23
enable : true ,
22
24
url : "127.0.0.1" ,
23
25
type2 : false
24
26
} ,
25
- ip : "127.0.0.1" ,
26
- port : 17091 ,
27
27
enet : {
28
+ ip : "127.0.0.1" ,
29
+ port : 17091 ,
28
30
maxPeers : 1024 ,
29
31
useNewPacket : {
30
32
asClient : false
@@ -34,7 +36,7 @@ class Client extends EventEmitter {
34
36
options
35
37
) ;
36
38
37
- this . _client = new Native ( this . config . ip , this . config . port ) as ClientType ;
39
+ this . _client = new Native ( this . config . enet . ip , this . config . enet . port ) as ClientType ;
38
40
}
39
41
40
42
public on ( event : "connect" , listener : ( netID : number ) => void ) : this;
@@ -94,7 +96,7 @@ class Client extends EventEmitter {
94
96
private startWeb ( ) {
95
97
if ( ! this . config . https ) return ;
96
98
if ( this . config . https . enable )
97
- WebServer ( this . config . ip , this . config . port , this . config . https . type2 ) ;
99
+ WebServer ( this . config . https . ip , this . config . https . port , this . config . https . type2 ) ;
98
100
}
99
101
100
102
private handleEvent ( ) {
Original file line number Diff line number Diff line change @@ -17,13 +17,15 @@ export interface ClientType {
17
17
export interface ClientOptions {
18
18
/** Built-in https web server */
19
19
https ?: {
20
+ ip ?: string ;
21
+ port ?: number ;
20
22
enable ?: boolean ;
21
23
url ?: string ;
22
24
type2 ?: boolean ;
23
25
} ;
24
- ip ?: string ;
25
- port ?: number ;
26
26
enet ?: {
27
+ ip ?: string ;
28
+ port ?: number ;
27
29
maxPeers ?: number ;
28
30
useNewPacket ?: {
29
31
asClient ?: boolean ;
You can’t perform that action at this time.
0 commit comments