I am trying to download pdf files present in a website using perl MECHANIZE module.
It worked fine when i am running the program without any proxy connection. But i am getting the below error when i tried to run the program on the company server which uses proxy connection.
error:
Error GETing http://www.google.com: Can't connect to www.google.com:80
(10060) a t Download.pl line 20.
I am not sure if i need to add any proxy details in the program or Is this something that our company firewall is blocking programatical requests to a website ?
I have tried a lot but coudn't find out. Can any one of you please suggest?
If you using some kind of LWP related module you could set the following shell variables
HTTP_PROXY=your.corp.proxy:your_proxy_port
You could check the connection with telnet or with wget
telnet www.google.com 80
with wget
wget http://www.google.com
You need to specify you proxy to the $mech:
$mech->proxy(['http'], 'http://proxy_address:proxy_port/');
Related
I am getting a strange error in my file upload application.
1) Server 1: It is secure web server on port 443, which is accessible to public hosting a perl script
2) When this server get a request for cgi-bin directory, it will simple redirect the request to other web server (Server 2) running on port 80
3) The perl script in Server 2 will save the file in disk
Issue:
Above mechanism worked for a couple of hours later it has thrown Http error code:508
Observations:
If I directly hit Server2 on port 80, perl script successfully saving the files to disk. But If I directly hit Server1 on port 443, I am getting 508 error
When I first got the issue, I have restarted both webservers and it worked. But when I get the same issue second time, restart of servers did not help. The call to Server1 is throwing 508 error and requests are getting timed out.
ulimits and open files are in control.
If you experience this type of issue, please share your thoughts.
This strange issue has been resolved after moving dynamic service to other Virtual machine. This issue is no longer reproducible after changing the node.
I was setting up a lighttpd server in my ARM device. Server was set successfully. Now I enabled all the debug prints in the lighttpd config file for tracking the server activities. All these debug prints can be seen in an error.log file. Is there some way that i can print these logs directly to my terminal as they happen.
Since lighttpd is designed to be run as a service I suspect the best way to achieve this would be to run tail -f on error.log. This may not be ideal as if you have multiple virtual hosts running on one lighttpd install you will have every sites debug log in amongst the wanted messages. Sadly, there is currently no way to have a separate error log for each vHost, although this has been requested as a feature.
I have set up a google cloud sql server using the tutorial on youtube. However, Whenever I try to connect to it through the browser, the connect to it through the browser, the error i am getting is ERR_CONNECTION_REFUSED . The firewalls I have set up correlate to whats in the browser. I can also SSH into the VM. But the VM always rejects my connection. I have been trying for days.
Here are my VM Settings allowing http connections
Here is my VM External IP Address
Here is what the browser tells me when i attempt to connect.
Are you referring to this video https://www.youtube.com/watch?v=_kQXgjIfLgo?
In that video there are some steps missing such as install the web server (e.g. Apache) and PHP in the VM. After you install them, you can execute the following command in the VM:
php /var/www/index.php
If it works you can see the source code of the resulting page and if not you'll have an error to solve (maybe a package to install like php-mysql).
Once you can see the resulting page in the VM you can try to load the page through the browser of your machine. If it still doesn't work there is an Apache or network misconfiguration.
I am trying to get content from a wordpress installation on a subdomain of my server. I tried that with file_get_content and also with Zend_Http_Client.
$client = new Zend_Http_Client(Zend_Registry::get('CONFIG')->static->$name->$lang);
$content = $client->request()->getBody();
As long as I run in on my localhost, it works fine. As soon as it runs on the same server as the subdomain, it hangs forever (timeout).
Specs:
Zend Framework Application trying to get HTML from a Wordpress Page
Server running on lighttpd
Several cores, much ram
Do you guys have an idea on how this problem can be resolved? Cheerio
One of the things you can also use is tcpdump to follow the network packets. That might give you an idea of if the problem is occurring in PHP, on the network or on the server side of the equation. You can take the output of tcpdump, write it to a file, and then load it up using something like Wireshark to inspect the packets.
How do I get command line utilities like ping to use the default proxy in Windows XP.
proxycfg -u sets the proxy to the default (IE) proxy alright, but it doesn't seem to be working.
Update: I am behind a proxy and would like a way to check if a site is up or not hence trying to use ping! Also would like a way to telnet (without using Putty) to a specific site and port to check connectivity.
A proxy is usually used for web (HTTP) traffic, ping uses ICMP, which is a completely separate protocol. What, exactly are you trying to do?
So, standard ping doesn't go via an HTTP proxy, as everyone's already mentioned. What you probably want is to tunnel your TCP connections (e.g., HTTP, telnet, ssh) via your HTTP proxy using the CONNECT method. For instance, using netcat (telnet will also work, but netcat's better) you'll do the following:
$ nc yourproxy 3128
CONNECT yourtelnetserver:23 HTTP/1.0
then press enter twice.
There are also tools that can do this for you. Keep in mind that some HTTP proxies are configured to allow CONNECT connections only to certain destinations, for example, to port 443 ony (for TLS/SSL/HTTPS).
Ping doesn't use TCP - it uses ICMP, so using a proxy doesn't really make sense.
Do you have another command line utility in mind?
Your best bet will probably be a command line browser for Windows.
You can try out lynx, which is nearly a full browser, or you can go something simpler and use wget. I would recommend wget myself.
Both programs have some way of configuring a proxy, and the documentation should be the same for both Linux and Windows versions.