如何获取公网IP
地址: curl http://ip.wang-li.top:93/4u6385IP Linux: # curl http://ip.wang-li.top:93/4u6385IP Python: #!/usr/bin/env python3 import requests def main (): url = "http://ip.wang-li.top:93/4u6385IP" MyIP = requests . get ( url ). text print ( MyIP ) if __name__ == '__main__' : main () Go: package main import ( "fmt" "io/ioutil" "net/http" ) func main () { url := "http://ip.wang-li.top:93/4u6385IP" resp , err := http . Get ( url ); if err != nil { fmt . Println ( "Http Connect Error" , err ) } else { b , err := ioutil . ReadAll ( resp . Body ); if err != nil { fmt . Println ( "Read Body Error" , err