Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
03-31-2014, 06:50 PM
|
#1
|
Member
Registered: Oct 2013
Posts: 531
Rep:
|
How to run an script and its commands via proxy?
Hi,
i used this tutorial which tells me to use following example command to proxify traffic from my linux
Code:
export {http,https,ftp}_proxy=122.228.156.126:80
when i do this command from command line it works and then i curl http://site/ipcheck.php i see its proxified, which is what i want to achieve.
BUT, i have bash script in which i execute that command.. but from mentioned bash script im then executing another perl script and I want to ask how to make sure commands in that perl script goes via proxy too, without editting that perl script.
Because i see that the traffic initiated by that perl script not goes via proxy
thank you
Last edited by postcd; 03-31-2014 at 06:53 PM.
|
|
|
04-01-2014, 02:41 AM
|
#2
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 23,247
|
that depends on those commands. Would be nice to show us that script (or a relevant part). Actually those variables {http,https,ftp}_proxy are not understood in general, but used by some apps like curl.
|
|
|
04-05-2014, 11:38 AM
|
#4
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 23,247
|
actually it is a perl script, not a bash. it uses direct connection, it will not use those setting. You need to modify this script to handle proxy settings.
|
|
|
04-06-2014, 10:25 AM
|
#5
|
Member
Registered: Oct 2013
Posts: 531
Original Poster
Rep:
|
How exactly i can modiffy its main function to run thru proxy? Please can you or anyone link to example, or how to run whole perl script thru proxy?
|
|
|
04-07-2014, 01:24 AM
|
#6
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 23,247
|
looks like you need to rewrite the whole script using LWP or similar (there is no main function).
the other way can be to direct the host to go thru proxy, but I do not know your environment, therefore cannot suggest any solution
|
|
|
04-08-2014, 03:51 AM
|
#7
|
Member
Registered: Oct 2013
Posts: 531
Original Poster
Rep:
|
Quote:
Originally Posted by pan64
the other way can be to direct the host to go thru proxy, but I do not know your environment, therefore cannot suggest any solution
|
I have Redhat 5.x , but i can use it on Ubuntu or any other you know solution for. Please if you know any solution you talking about for any OS, please just share it if u can.
|
|
|
04-08-2014, 04:00 AM
|
#8
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 23,247
|
You missed: you need another host to act as proxy and you need to send network traffic to that host
|
|
|
04-09-2014, 02:19 PM
|
#9
|
Member
Registered: Oct 2013
Posts: 531
Original Poster
Rep:
|
Yes, i already have another host which i want to use as a proxy (i have open port there for proxy purpose open only to my IP....
|
|
|
All times are GMT -5. The time now is 08:05 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|