Skip to content

Commit 56fe392

Browse files
committed
make http possible
1 parent 5d38bc5 commit 56fe392

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

main.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ ipcMain.on("test", async (event,arg) => {
133133
plain=await send2wavelog(arg,DemoAdif, true);
134134
} catch (e) {
135135
plain=e;
136+
console.log(plain);
136137
} finally {
137138
try {
138139
result.payload=JSON.parse(plain.resString);
@@ -185,7 +186,11 @@ function send2wavelog(o_cfg,adif, dryrun = false) {
185186
clpayload.string=adif;
186187
// console.log(clpayload);
187188
postData=JSON.stringify(clpayload);
188-
const https = require('https');
189+
let httpmod='http';
190+
if (o_cfg.wavelog_url.toLowerCase().startsWith('https')) {
191+
httpmod='https';
192+
}
193+
const https = require(httpmod);
189194
var options = {
190195
method: 'POST',
191196
timeout: 5000,

0 commit comments

Comments
 (0)