How do I set proxy for lynx

Nagaraju picture Nagaraju · Sep 28, 2015 · Viewed 12.7k times · Source

I am trying to run lynx in my perl cgi script so it extracts some text from wen page. I am doing it as in the following manner in my script,

lynx -source -preparsed "$url" > data.txt

But I get the following error in my server's error_log:

Looking up www.xyz.com

Making HTTP connection to www.xyz.com Alert!:

Unable to connect to remote host.

lynx: Can't access startfile xyz.com

I get the same error when I tried to execute lynx from the command line for root user. But the perl script and the lynx command work normally when I run it in normal user.Our newtwork consists of proxy settings which I had done in /etc/lynx-site.cfg as PROTOCOL_proxy="http://proxy.abcdxyz.ac.in:8080".But it hasnot given any result.

Answer

Nagaraju picture Nagaraju · Sep 29, 2015

Set a Lynx proxy as follows:

  1. Edit /etc/lynx-site.cfg
  2. Add:

    http_proxy:http://proxy.abc.xyz:8080
    

The proxy is set.