Skip to content

Commit c65f5f8

Browse files
author
android-js
authored
Merge pull request #5 from DeveshPankaj/master
Fixed: URL loading problem
2 parents f9288cd + 6f9c104 commit c65f5f8

File tree

985 files changed

+41
-15
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

985 files changed

+41
-15
lines changed

chat-app/.DS_Store

-8 KB
Binary file not shown.

chat-app/README.md

100644100755
File mode changed.

chat-app/assets/.DS_Store

-6 KB
Binary file not shown.

chat-app/assets/icon/app3.png

5 KB
27.5 KB
9.27 KB

chat-app/assets/icon/icon.png

25.7 KB

chat-app/assets/ipc/front.js

100644100755
File mode changed.

chat-app/main.js

100644100755
Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,37 @@ const ip_npm = require('ip');
66

77
var localtunnel = require('localtunnel');
88

9-
var tunnel = localtunnel(3001, function(err, tunnel) {
10-
if (err) throw err;
11-
console.log(tunnel.url);
12-
ip = tunnel.url;
13-
});
14-
15-
tunnel.on('close', function() {
16-
console.log('tunnel, closed');
17-
});
18-
19-
209

2110
http.listen(3001);
2211

2312

2413
let ip = undefined;
25-
ip = ip_npm.address();
14+
//ip = ip_npm.address();
2615
// (async () => {
2716
// ip = await publicIp.v4();
2817
// })();
2918

19+
var tunnel = localtunnel(3001, function(err, tunnel) {
20+
if (err) throw err;
21+
console.log(tunnel.url);
22+
ip = tunnel.url;
23+
});
24+
25+
tunnel.on('close', function() {
26+
console.log('tunnel, closed');
27+
});
28+
29+
30+
3031
// MY CHAT APP
3132
back.on('get-ip', function () {
32-
console.log('ip request');
33-
return ip;
33+
setTimeout(()=>{
34+
if(ip !== undefined){
35+
back.send('ip', ip);
36+
}else{
37+
back.send('ip', "Failed: to get url");
38+
}
39+
}, 4000);
3440
});
3541

3642

chat-app/node_modules/@sindresorhus/is/dist/index.d.ts

100644100755
File mode changed.

0 commit comments

Comments
 (0)