Internet
Properties
$ip
php
public static string|false $ip$online
php
public static bool $onlineMethods
getIP()
php
public static function getIP(bool $force = false) : string|falseLazily gets the External IP using an external service and caches the result
getInternalIP()
php
public static function getInternalIP() : stringReturns the machine's internal network IP address. If the machine is not behind a router, this may be the same as the external IP.
getURL()
php
public static function getURL(string $page, int $timeout = 10, array $extraHeaders = [], &$err = null) : ?\pocketmine\utils\InternetRequestResultGETs an URL using cURL NOTE: This is a blocking operation and can take a significant amount of time. It is inadvisable to use this method on the main thread.
postURL()
php
public static function postURL(string $page, array|string $args, int $timeout = 10, array $extraHeaders = [], &$err = null) : ?\pocketmine\utils\InternetRequestResultPOSTs data to an URL NOTE: This is a blocking operation and can take a significant amount of time. It is inadvisable to use this method on the main thread.
simpleCurl()
php
public static function simpleCurl(string $page, float $timeout = 10, array $extraHeaders = [], array $extraOpts = [], ?\Closure $onSuccess = null) : \pocketmine\utils\InternetRequestResultGeneral cURL shorthand function. NOTE: This is a blocking operation and can take a significant amount of time. It is inadvisable to use this method on the main thread.
