Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I set proxy for lynx [closed]

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.

like image 590
Nagaraju Avatar asked Sep 28 '15 11:09

Nagaraju


People also ask

How do I know if proxy is enabled Linux?

Method 1: Start a new shell (xterm), then check the environment variables: % env | grep -i proxy http_proxy=http://172.17.0.130:8080/ ftp_proxy=ftp://172.17.0.130:8080/ all_proxy=socks://172.17.0.130:8080/ ... Note that existing shells will not have updated environment variables.


1 Answers

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.

like image 158
Nagaraju Avatar answered Sep 21 '22 18:09

Nagaraju