Skip to content

在網頁中顯示伺服器IP、客戶端IP並顯示ping。每次ping將傳送至discord webhook。

Notifications You must be signed in to change notification settings

CheapServer/web-ip-and-ping

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

介紹

在網頁中顯示伺服器IP、客戶端IP並顯示ping。每次ping將傳送至discord webhook。

功能

連線至網頁,會提供您下面的資訊:
image
並傳送至webhook
image

安裝

  1. 需要先安裝nodeJS 18以上的版本
  2. 下載並解壓縮檔案
  3. 將server.js的 11、12行改掉
const webhookId = '12345678'; //設定webhook ID
const webhookToken = 'abcdefghijk'; //設定webhook token

(webhook ID跟token去哪裡拿? 這裡有webhook範例網址: https://discord.com/api/webhooks/ID/token)

  1. 安裝套件
npm install
  1. 打開來即可完成! (node server.js)
  2. 如果要放在systemctl裡面的話,這裡是ping.service的範例 (放在 /etc/systemd/system/ping.servicesystemctl enable ping && systemctl start ping):
[Unit]
Description=CheapServer Edge PING

[Service]
User=root
WorkingDirectory=/root/edge-ping
LimitNOFILE=4096
ExecStart=/usr/bin/node /root/edge-ping/server.js
Restart=on-failure
StartLimitInterval=180
StartLimitBurst=30
RestartSec=5s

[Install]
WantedBy=multi-user.target

特別感謝

本程式碼部分使用 GPT-4 編寫,這裡要說他比 GPT-3.5 好用多ㄌ

About

在網頁中顯示伺服器IP、客戶端IP並顯示ping。每次ping將傳送至discord webhook。

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published