error di vps + install node.js
salam, baharu saya follow install whatapp-api-tutorial tapi buka link error :
(failed)net::ERR_CONNECTION_TIMED_OUT
di status index.js:83 GET /:8000/socket.io/?EIO=3&transport=polling&t=NUog27E net::ERR_CONNECTION_TIMED_OUT
install di VPS + Node.js + apanel port 8000 - done create at firewall
kenapa ya.
Apakah clientnya di domain yang sama?
ya domain yang sama, tapi domain configure di cloudflare enable dns + https
-- sebelum ini bila gunanya code
var socket = io.connect();
errornya console : CORS
bila buat buat baru file edit
var socket = io.connect(':8000');
errornya : (failed)net::ERR_CONNECTION_TIMED_OUT
Sudah coba gunakan var socket = io();?
Sudah coba gunakan
var socket = io();?
sudah.
errornya ;
index.js:83 GET https /socket.io/?EIO=3&transport=polling&t=NUos8tS 404
Request URL: https:// domainya .com/socket.io/?EIO=3&transport=polling&t=NUosBe4 Request Method: GET Status Code: 404 Remote Address: [2606:4700:3035::ac43:cf7b]:443 Referrer Policy: strict-origin-when-cross-origin cache-control: private, no-cache, max-age=0 cf-cache-status: DYNAMIC cf-ray: 62341f2ff8e421d6-HKG cf-request-id: 085471d1fc000021d646b2c000000001 content-type: text/html date: Thu, 18 Feb 2021 01:54:44 GMT expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" nel: {"report_to":"cf-nel","max_age":604800} pragma: no-cache report-to: {"max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report?s=oWpT0HOxq9w81U5hpV6WdmK0LwjK7lA%2BumkfJ2PiaNESkkuIHfDTM9QnmY3tDZmMnAY55vcidQH%2FH4hB4S0lGpOH6UjkEAIsW3nm3PI%2Bp0t2pYMlWC3WqVH9gjk4nPVG72ru"}],"group":"cf-nel"} server: cloudflare vary: Accept-Encoding :authority: domain .com :method: GET :path: /socket.io/?EIO=3&transport=polling&t=NUosBe4 :scheme: https accept: / accept-encoding: gzip, deflate, br accept-language: en-US,en;q=0.9 cookie: __cfduid=d36651e5587184678fc16b5a3af75eb371613604799 referer: https:// domain .com/ sec-fetch-dest: empty sec-fetch-mode: cors sec-fetch-site: same-origin user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36 EIO: 3 transport: polling t: NUosBe4
Kalau akses pakai IP bisa? Kebetulan saya belum pernah pakai Cloudflare
Saya pakai Reverse Proxy Apache bisa akses lewat domain.
apache. kalau litespeed server bisa ?
ni setting di apanel saya guna.

Saya atur seperti ini
ProxyPreserveHost On
ProxyPass /myapp http://localhost:3000
Sehingga aksesnya lewat domain.com/myapp
oh ya. apache.
gimana guna OLS bisa run proxy reserve ?
utk code ini. bisa untuk OLS ?
const http = require('http');
const hostname = '127.0.0.1';
const port = 3000;
const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end('Hello World form node js app.js\n');
});
server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});
source : https://openlitespeed.org/kb/running-node-js-apps-with-openlitespeed/
gimana mau setting di app.js ?
Saya atur seperti ini
ProxyPreserveHost On ProxyPass /myapp http://localhost:3000Sehingga aksesnya lewat domain.com/myapp
sudah solve.
....
sekarang errornya bahagian multiple device
Cannot GET /whatapp-api error.
bahagian terminal port run normally.
Mungkin salah akses URL saja.
Mungkin salah akses URL saja.
selesai..
tapi bila buat run code.... qrcode di site jadi error
ini screencapturenya.

tapi di console tiada errornya.
Mungkin salah akses URL saja.
gimana mau kurangkan load server untuk running app.js limit untuk scan qr cuma 3 - 5 kali retry sahaja ya?
perlu setting di reverse proxy atau buat code yang baru.
Sudah coba gunakan
var socket = io();?sudah.
errornya ;
index.js:83 GET https /socket.io/?EIO=3&transport=polling&t=NUos8tS 404
Request URL: https:// domainya .com/socket.io/?EIO=3&transport=polling&t=NUosBe4 Request Method: GET Status Code: 404 Remote Address: [2606:4700:3035::ac43:cf7b]:443 Referrer Policy: strict-origin-when-cross-origin cache-control: private, no-cache, max-age=0 cf-cache-status: DYNAMIC cf-ray: 62341f2ff8e421d6-HKG cf-request-id: 085471d1fc000021d646b2c000000001 content-type: text/html date: Thu, 18 Feb 2021 01:54:44 GMT expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" nel: {"report_to":"cf-nel","max_age":604800} pragma: no-cache report-to: {"max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report?s=oWpT0HOxq9w81U5hpV6WdmK0LwjK7lA%2BumkfJ2PiaNESkkuIHfDTM9QnmY3tDZmMnAY55vcidQH%2FH4hB4S0lGpOH6UjkEAIsW3nm3PI%2Bp0t2pYMlWC3WqVH9gjk4nPVG72ru"}],"group":"cf-nel"} server: cloudflare vary: Accept-Encoding :authority: domain .com :method: GET :path: /socket.io/?EIO=3&transport=polling&t=NUosBe4 :scheme: https accept: / accept-encoding: gzip, deflate, br accept-language: en-US,en;q=0.9 cookie: __cfduid=d36651e5587184678fc16b5a3af75eb371613604799 referer: https:// domain .com/ sec-fetch-dest: empty sec-fetch-mode: cors sec-fetch-site: same-origin user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36 EIO: 3 transport: polling t: NUosBe4
saya ada kendala sama seperti ini. apa solusinya ya, boleh di share. saya running di nodejs plesk panel
Saya atur seperti ini
ProxyPreserveHost On ProxyPass /myapp http://localhost:3000Sehingga aksesnya lewat domain.com/myapp
sudah solve.
....
sekarang errornya bahagian multiple device
Cannot GET /whatapp-api error.
bahagian terminal port run normally.
bagaimana seting proxy melalui client index.html, saya tidak punya akses ke server, sy guna plesk panel untuk run node js
untuk cludflare tidak semua port bisa digunakan silahkan gunakan port yg sesuai By default, Cloudflare proxies traffic destined for the HTTP/HTTPS ports listed below.
HTTP ports supported by Cloudflare:
80
8080
8880
2052
2082
2086
2095
HTTPS ports supported by Cloudflare:
443
2053
2083
2087
2096
8443