scistag.webstag.web_helper.WebHelper

class WebHelper[source]

Bases: object

Helper function for resolving host ips and then own IP

Methods

get_public_ip

Returns the server's public IP as seen by other servers by using the IP resolving service defined.

Attributes

__dict__

__doc__

__module__

__weakref__

list of weak references to the object (if defined)

static get_public_ip(timeout_s=5.0, max_cache_age=86400.0)[source]

Returns the server’s public IP as seen by other servers by using the IP resolving service defined. (at the moment limited to ipify).

Parameters
  • timeout_s – The maximum response timeout in seconds

  • max_cache_age – The time in seconds for how long the result shall be cached.

Return type

str | None

Returns

The IP