You are not logged in.

#1 2011-01-28 07:13:43

jaideep_jdof
Member
From: Delhi, India
Registered: 2006-06-05
Posts: 311

Openbox and proxy issues[Solved]

I am using openbox as my wm. I am facing a proxy issue.
I have added two functions in my .bashrc (based on https://wiki.archlinux.org/index.php/Proxy_settings):

function proxyon(){
    echo -n "username:"
    read -e username
    echo -n "password:"
    read -es password
    export http_proxy="http://$username:$password@proxyserver:8080/"
    export ftp_proxy="http://$username:$password@proxyserver:8080/"
    echo -e "\nProxy environment variable set."
}
function proxyoff(){
    unset HTTP_PROXY
    unset http_proxy
    unset FTP_PROXY
    unset ftp_proxy
    echo -e "\nProxy environment variable removed."
}

but after login when i run the command 'proxyon' and then launch firefox from openbox menu, firefox doesn't pick up the env variables but if I launch firefox from the same shell where i run 'proxyon' command firefox picks up the variables perfectly.
I have tried adding:

export http_proxy="http://$username:$password@proxyserver:8080/"
    export ftp_proxy="http://$username:$password@proxyserver:8080/"

to .bashrc directly still launching firefox from openbox menu doesn't pickup proxy settings.

Also I want to know how do I add proxy exception for a perticular url.

Last edited by jaideep_jdof (2011-01-31 11:00:05)

Offline

#2 2011-01-31 05:57:36

jaideep_jdof
Member
From: Delhi, India
Registered: 2006-06-05
Posts: 311

Re: Openbox and proxy issues[Solved]

Is there a gui to switch proxy

Offline

#3 2011-01-31 06:21:59

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: Openbox and proxy issues[Solved]

Try adding them to .bash_profile. I think .bashrc is only read when launching a shell.
Edit .bash_profile, then log out and log back in to test it.

If nothing else works, you can write your own wrapper script for Firefox and launch it via the script in Openbox, e.g.

#!/bin/bash
export http_proxy="http://$username:$password@proxyserver:8080/"
export ftp_proxy="http://$username:$password@proxyserver:8080/"
firefox "$@"

It might not be the most elegant solution, but it's the first thing that came to mind.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#4 2011-01-31 09:32:38

jaideep_jdof
Member
From: Delhi, India
Registered: 2006-06-05
Posts: 311

Re: Openbox and proxy issues[Solved]

thanks a lot it worked.

Offline

Board footer

Powered by FluxBB