Skip to main content

Get outgoing ip from https://zencore.cn/ipinfo.

Project description

zencoreipinfo

Get outgoing ip from https://zencore.cn/ipinfo.

Install

pip install zencoreipinfo

Usage in Cli

test@test zencoreipinfo % ipinfo --help
Usage: ipinfo [OPTIONS]

Options:
  --url TEXT   Server url. Can apply multiple times.
  -q, --quiet  Don't show error information.
  --help       Show this message and exit.

test@test zencoreipinfo % ipinfo
aaa.xxx.yy.zz

  1. By default, the program will use the default ipinfo server https://zencore.cn/ipinfo.
  2. We ship cli program in name ipinfo, and zencoreipinfo as it's alias.

Usage in Script

In [1]: from zencoreipinfo import get_outgoing_ip

In [2]: ip = get_outgoing_ip()

In [3]: print(ip)
aaa.xxx.yy.zz

How to implement self ipinfo server?

You need a linux server with a public ip address, and you need to install nginx service on the linux server. Add the ipinfo location into your site.

# your other configs

location /ipinfo {
    add_header Content-Type text/plain;
    return 200 $remote_addr;
}

# your other configs

After you setup your ipinfo server. Run the ipinfo command with --url prarameter.

test@test zencoreipinfo % ipinfo --url https://you.site.domain.cn/ipinfo
aaa.xxx.yy.zz

About the ipinfo server of zencore.cn

We do not promise continuity or reliability of the service.

Release

0.1.0

  • First release.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zencoreipinfo-0.1.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

zencoreipinfo-0.1.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file zencoreipinfo-0.1.0.tar.gz.

File metadata

  • Download URL: zencoreipinfo-0.1.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for zencoreipinfo-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0aaba3b8693dec64b6b734264dd56011fa56d62c67e8e0190c86aabc7b09afb3
MD5 3af419ac8df46423321f0a1b7ae32d60
BLAKE2b-256 ec5fbacfa94687fa8522c8b1add49af83ec0fa753c5119272a251d0ecd8fec76

See more details on using hashes here.

File details

Details for the file zencoreipinfo-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for zencoreipinfo-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 30c841df25207e119e45f3c5cbe17cb4ce0ec88d8cd3dc1e786d13ae8fc27fd8
MD5 c4d1aeed85885ec34b5f764735b2c140
BLAKE2b-256 2cd30bf5ab32dd500fcb54af0f1ca7077b8c3586bd5e194e487bfad9614c947e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page