tlsd 2.12.1 → 2.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/tlsd.js +25 -5
package/package.json
CHANGED
package/tlsd.js
CHANGED
|
@@ -82,16 +82,36 @@ function rpc_handler( root, msg, transport, _okay, _fail ) {
|
|
|
82
82
|
};
|
|
83
83
|
|
|
84
84
|
try {
|
|
85
|
-
|
|
85
|
+
// try loading explicit common js module
|
|
86
|
+
const path = root + "/rpc/index.cjs";
|
|
87
|
+
V( "path=" + path );
|
|
88
|
+
const mod = require( path );
|
|
86
89
|
try {
|
|
87
90
|
mod( msg, okay, ouch, transport );
|
|
88
91
|
} catch( err ) {
|
|
89
|
-
|
|
90
|
-
|
|
92
|
+
E( (err instanceof Error ) ? err.stack : err );
|
|
93
|
+
ouch( "RPC handler exception" );
|
|
91
94
|
}
|
|
95
|
+
|
|
92
96
|
} catch( err ) {
|
|
93
|
-
|
|
94
|
-
|
|
97
|
+
|
|
98
|
+
// try loading it the old way using the dir
|
|
99
|
+
try {
|
|
100
|
+
const path = root + "/rpc";
|
|
101
|
+
V( "path=" + path );
|
|
102
|
+
const mod = require( path );
|
|
103
|
+
try {
|
|
104
|
+
mod( msg, okay, ouch, transport );
|
|
105
|
+
} catch( err ) {
|
|
106
|
+
E( (err instanceof Error ) ? err.stack : err );
|
|
107
|
+
ouch( "RPC handler exception" );
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
} catch( err ) {
|
|
111
|
+
E( (err instanceof Error ) ? err.stack : err );
|
|
112
|
+
ouch( "Error loading RPC handler" );
|
|
113
|
+
}
|
|
114
|
+
|
|
95
115
|
}
|
|
96
116
|
};
|
|
97
117
|
|