mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-04 12:40:07 +00:00
🚸 release: v0.2.1
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"fmt"
|
||||
"log"
|
||||
"net"
|
||||
"net/http"
|
||||
"os/exec"
|
||||
"time"
|
||||
|
||||
@@ -13,11 +15,23 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
// 跳过 SSL 检查
|
||||
transCfg := &http.Transport{
|
||||
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
|
||||
}
|
||||
httpClient := &http.Client{Transport: transCfg}
|
||||
_, err := httpClient.Get("https://expired-ecc-dv.ssl.com")
|
||||
fmt.Println(err)
|
||||
// SSL 证书信息获取
|
||||
c := cert.NewCert("expired-ecc-dv.ssl.com")
|
||||
fmt.Println(c.Error)
|
||||
// TCP
|
||||
conn, err := net.DialTimeout("tcp", "example.com:80", time.Second*10)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
println(conn)
|
||||
// ICMP Ping
|
||||
pinger, err := ping.NewPinger("example.com")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
@@ -28,11 +42,7 @@ func main() {
|
||||
panic(err)
|
||||
}
|
||||
fmt.Printf("%+v", pinger.Statistics())
|
||||
certs, err := cert.NewCerts([]string{"example.com"})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fmt.Println(certs)
|
||||
// 硬盘信息
|
||||
dparts, _ := disk.Partitions(false)
|
||||
for _, part := range dparts {
|
||||
u, _ := disk.Usage(part.Mountpoint)
|
||||
|
||||
Reference in New Issue
Block a user