Bug 147340 - [KDE4] Add support for "ssh -D ..."-type of "poor man's Socks proxy" to Konqueror
Summary: [KDE4] Add support for "ssh -D ..."-type of "poor man's Socks proxy" to Konqu...
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: knetwork (show other bugs)
Version: 4.0
Platform: openSUSE Linux
: HI wishlist
Target Milestone: ---
Assignee: Dawit Alemayehu
URL:
Keywords:
: 142183 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-06-29 03:08 UTC by Kurt Pfeifle
Modified: 2011-10-20 06:16 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.8


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kurt Pfeifle 2007-06-29 03:08:26 UTC
Version:           3.5.7 ("release 47.1" openSUSE) (using KDE KDE 3.5.7)
Installed from:    SuSE RPMs
OS:                Linux

Lately I'm forced to use a "Socks" proxy quite often in order to 

  (1) get an Internet connection at all through a firewall,
  (2) or in order to make it more secure when on an unsecure network 
      (like public hotspot in hotel/airport/etc.).,
  (3) or in order to access services on ports that the proxy is not
      configured to serve (irc://, news://, ...)

The way I set it up is this:


  (a) create an encrypted SSH connection to a secure remote host using 
      the (little known "-D portnumber" parameter to ssh command):

      ssh -i ~/.ssh/remote.key -p 8080 kurt@remotehost -N -D 28080 -f

      Above command...
        ...connects to me to remotehost:8080,
        ...(which is allowed by proxy), 
        ...because remotehost has sshd configured to listen there,
        ..."-f" backgrounds the connection,
        ..."-N" tells it to not execute any command,
        ..."-D" creates a 'dynamic' application-level portforwarding from 
           local port :28080,

      "-D portnumber" can be said to provide "poor man's Socks4/Socks5 
      proxy" handled by SSH. 


  (b) For the proxy configuration in Firefox and Thunderbird I use this
      setting:
      +-----------------------------------------------------------------+
      |                                                                 |
      |  [x] Manual Proxy Configuration                                 |
      |                                                                 |
      |     HTTP Proxy:[..............................]  Port:[0......] |
      |                [.] Use this proxy for all protocols             |
      |                                                                 |
      |      SSL Proxy:[..............................]  Port:[0......] |
      |      FTP Proxy:[..............................]  Port:[0......] |
      |   Gopher Proxy:[..............................]  Port:[0......] |
      |     SOCKS Host:[..localhost...................]  Port:[.28080.] |
      |                                                                 |
      +-----------------------------------------------------------------+

It works beautifully.... if I use Firefox and Thunderbird or even Inter-
net Explorer in Wine! (By adding "-g" to the ssh command line, (I can
even enable my local socks proxy to accept and pass on requests from
other local computers using software that is socks-enabled...)

Unfortunately.... this.does.not.work.in.KDE !

I can't figure out how Socks proxy support is supposed to work *at* *all*
in KDE (see screenshot)! (Probably, in an attempt to make it "magically
work" with auto-configuration only and hiding the ugly details from the
user, one can't even simply set a proxy name/ip-address and port when
it comes to the Socks protocol. Why is this? Why is this so different
from the handling of http-, https-, ftp- and gopher-proxies?!

Here is how the same configuration dialog looks in Konqueror (as you may
be well aware):

      +-- Servers ------------------------------------------------------+
      |                                                                 |
      |     HTTP:[..............................]  Port:[0......]       |
      |    HTTPS:[..............................]  Port:[0......]       |
      |      FTP:[..............................]  Port:[0......]       |
      |                                                                 |
      |          [.] Use same proxy server for all protocols            |
      |                                                                 |
      +-----------------------------------------------------------------+

The Socks proxy configuration is outsourced to a separate tab. It looks
like this:
      +-----------------------------------------------------------------+
      |                                                                 |
      |  [x] Enable SOCKS support                                       |
      |                                                                 |
      |  +--SOCKS Implementation-------------------------------------+  |  
      |  |                                                           |  |
      |  | [x] Auto detect   [.] NEC SOCKS    [.] Dante              |  |
      |  |                                                           |  |
      |  | [.] Use custom library                                    |  |
      |  |                                                           |  |
      |  | Path: [...........................................]       |  |
      |  |                                                           |  |
      |  +-----------------------------------------------------------+  |
      |                                                                 |
      |  +--Additional library search paths--------------------------+  |
      |  |                                                           |  |
      |  |                                                           |  |
      |  |                                                           |  |
      |  |                                                           |  |
      |  |                                                           |  |
      |  +-----------------------------------------------------------+  |
      |                                                      +-------+  |
      |                                                      | Test  |  |
      |                                                      +-------+  |
      +-----------------------------------------------------------------+

WTF?!

Does *anyone* who has not coded this part understand how this is supposed 
to work?! (I challenge you to find 5 people at aKademy who can...)

This proxy configuration module does not even have *any* documentation
about how it is supposed to work (at least I could locate none); not even
the most minimal [meaningful!] "WhatsThis" help...

(I must admit the "test" button works beautifully... it always reports 
"Success: SOCKS was found and initialized." whatever settings I try there.

But alas!, no real Socks proxy connection for Konqui! 

No save Internet access with KDE on public hotspots for me. 

No news:// access to the CUPS and Linuxprinting.org forums with KNode 
when I work on a customer site with a fascist proxy/firewall in place (I 
succeed in most cases to have my customers grant me an outward SSH 
connection to my trusted "remotehost" before I ever start travelling to 
their sites).

##############

So, sad as it is, I can't use KMail, Kontact, Kopete, Konqueror and have
to limit myself to Firefox and Thunderbird and Internet Explorer (for most 
cases where I access the Internet).

Please, I have 2 urgent wishes:

  (a) fix that for KDE4; make it so that as many as possible KDE4 appli-
      cations can take advantage of this "poor man's Socks proxy via
      SSH"

  (b) backport it to KDE 3.5


Thanks for considering!

-- 
Kurt Pfeifle
System & Network Printing Consultant ---- Linux/Unix/Windows/Samba/CUPS
Infotec Deutschland GmbH  .....................  Hedelfinger Strasse 58
A RICOH Company  ...........................  D-70327 Stuttgart/Germany
Comment 1 Kurt Pfeifle 2007-06-29 03:38:25 UTC
Here is a list of similar bugs (that is, they are related b0rken "SOCKS proxy" settings): #142183, #112144, #23217, 
Comment 2 Kurt Pfeifle 2007-06-29 03:39:15 UTC
added "[KDE4]"to $summary
Comment 3 Thiago Macieira 2007-07-03 16:22:10 UTC
*** Bug 142183 has been marked as a duplicate of this bug. ***
Comment 4 Thiago Macieira 2007-07-03 16:23:40 UTC

*** This bug has been marked as a duplicate of 142183 ***
Comment 5 Thiago Macieira 2007-07-03 16:24:11 UTC
Uhh... that was stupid.
Comment 6 Michael Schramm 2010-02-28 18:47:21 UTC
Is there any estimate when this will be implemented / fixed?
Comment 7 Thiago Macieira 2010-02-28 19:08:30 UTC
There are no estimates for anything in KDE.

But I'm not working on it nor am I likely to work on it any time soon. This bug should be assigned to someone else.
Comment 8 SME 2010-10-08 15:08:08 UTC
Huh ... is there any progress in terms of bringing this necessary feature into KDE or just re-assigning this bug to someone else? I do seriously need this feature ...
Comment 9 Thiago Macieira 2010-10-08 19:59:08 UTC
I don't plan on working on this.

Anyone who wants to give it a try can just assign this bug to himself.
Comment 10 Robert Bredereck 2010-12-21 17:26:29 UTC
Probably, one should donate some holidays in China to some KDE developers. I think they would implement this very soon.

Anyone who wants to support my idea?
Comment 11 Dawit Alemayehu 2011-10-13 19:57:44 UTC
Support for SOCKS is already present in KDE 4.7. There are some regressions, but those are not SOCKS proxy specific and all of them will be worked out once 4.7.3 is released. See https://bugs.kde.org/show_bug.cgi?id=189019#c31 for how to add socks support in KDE 4.7.

For KDE 4.8 the GUI will be updated with input for SOCKS proxy as soon as https://git.reviewboard.kde.org/r/102802/ gets merged in.

As far as the poor man's SOCKS proxy support using ssh. I am afraid that is beyond the scope of KDE's proxy configuration dialog. However, once you set it up, you can use it as you would any othe SOCKS proxy server in KDE.
Comment 12 Dawit Alemayehu 2011-10-20 06:16:29 UTC
Git commit f90f318f2162df18a08b889d24ae8bbeab3b834c by Dawit Alemayehu.
Committed on 01/08/2011 at 07:44.
Pushed by adawit into branch 'master'.

Rewrote the proxy configuration dialog to include missing SOCKS
proxy entry and make it much simpler to use.

BUG:82352
BUG:115704
BUG:139789
BUG:147340
BUG:164460
BUG:189019
BUG:190149
BUG:190901
BUG:205594
BUG:258196
BUG:283226
FIXED-IN:4.8

REVIEW: 102802

GUI:  Proxy configuration dialog rewrite.

M  +0    -5    konqueror/settings/kio/CMakeLists.txt
D  +0    -251  konqueror/settings/kio/envvarproxy.ui
D  +0    -310  konqueror/settings/kio/kenvvarproxydlg.cpp
D  +0    -71   konqueror/settings/kio/kenvvarproxydlg.h
D  +0    -496  konqueror/settings/kio/kmanualproxydlg.cpp
D  +0    -86   konqueror/settings/kio/kmanualproxydlg.h
M  +410  -215  konqueror/settings/kio/kproxydlg.cpp
M  +30   -18   konqueror/settings/kio/kproxydlg.h
M  +833  -248  konqueror/settings/kio/kproxydlg.ui
D  +0    -79   konqueror/settings/kio/kproxydlgbase.cpp
D  +0    -69   konqueror/settings/kio/kproxydlgbase.h
M  +77   -88   konqueror/settings/kio/ksaveioconfig.cpp
M  +28   -32   konqueror/settings/kio/ksaveioconfig.h
D  +0    -291  konqueror/settings/kio/manualproxy.ui

http://commits.kde.org/kde-baseapps/f90f318f2162df18a08b889d24ae8bbeab3b834c