use strict; use warnings; use Win32::Internet; use Win32::API; #$Win32::API::DEBUG = 1; my $InternetGetProxyInfo = Win32::API->new('jsproxy.dll', 'BOOL InternetGetProxyInfo(LPCSTR lpszUrl, DWORD dwUrlLength, LPSTR lpszUrlHostName, DWORD dwUrlHostNameLength, LPSTR lplpszProxyHostName, LPDWORD lpdwProxyHostNameLength)') or warn "\n ERROR: Can not import API:i2cGetDeviceAddress , $^E ,"; my $lpszUrl = 'http://www.google.com'; my $dwUrlLength = length($lpszUrl); my $lpszUrlHostName = 'www.google.com'; my $dwUrlHostNameLength = length($lpszUrlHostName); my $lplpszProxyHostName = " " x 100; my $lpdwProxyHostNameLength = 0; print $InternetGetProxyInfo->Call($lpszUrl,$dwUrlLength,$lpszUrlHostName,$dwUrlHostNameLength,$lplpszProxyHostName,$lpdwProxyHostNameLength) or print "\n ERR: ",$^E; print "\n ERR:", Win32::FormatMessage(Win32::GetLastError()); print "\n 1: $lplpszProxyHostName \n 2: $lpdwProxyHostNameLength \n";