File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -3,21 +3,23 @@ require('dotenv').config();
3
3
const net = require ( 'net' ) ;
4
4
const client = new net . Socket ( ) ;
5
5
6
+ const token = '$2y$10$9z/ch9hTc5rNQF9ks7cQoui5ISEeTCa73Ixm3c2UiJawY33WrnuuG' ;
7
+
6
8
client . connect ( process . env . SERVER_PORT , process . env . SERVER_IP , ( ) => {
7
9
console . log ( "Connected" ) ;
8
- client . write ( "First Ping ... \n " ) ;
10
+ client . write ( "AUTHENTICATION=" + token , "utf8 ") ;
9
11
} ) ;
10
12
11
13
client . on ( "data" , ( data ) => {
12
- console . log ( "Received: " + data ) ;
13
-
14
- setTimeout ( ( ) => {
15
- let sent = "Pong ... \n" ;
16
- client . write ( sent ) ;
17
- console . log ( "Send: " + sent ) ;
18
- } , process . env . DEFAULT_PONG_INTERVAL ) ;
14
+ console . log ( "Received: " + data + "\n" ) ;
19
15
} ) ;
20
16
21
17
client . on ( "close" , ( ) => {
22
18
console . log ( "Connection closed" ) ;
23
19
} ) ;
20
+
21
+ setInterval ( ( ) => {
22
+ let sent = "Pong ..." ;
23
+ client . write ( sent ) ;
24
+ console . log ( "Send: " + sent ) ;
25
+ } , process . env . DEFAULT_PONG_INTERVAL ) ;
You can’t perform that action at this time.
0 commit comments