mirror of
https://github.com/irssi/irssi.git
synced 2026-08-09 20:00:23 +02:00
PROXY: implemented native proxy support
This patch creates a hook into the net_connect*() methods which call a method to connect to a proxy. Previous solution to send certain strings in the normal IRC dialog was some kind of hack as most proxies require some kind of negotation. E.g. HTTP proxies sent a 'HTTP/1.0 200 Connection established' HTTP header and clients have to wait for it. Else, sent bytes of the following IRC login will be dropped silently. With old method, it is also impossible to tunnel SSL IRC connections through the proxy as proxy speaks plain text or a special protocol while e.g. 'CONNECT ... HTTP/1.0' will be encrypted with key of IRC server. There are further enhancements possible: the whole net_connect stuff should be made asynchronously. Currently, only the hostname is resolved in the background (which makes little sense of local proxies usually).
This commit is contained in:
parent
3d6051a03e
commit
0236ee5eaa
12 changed files with 297 additions and 48 deletions
30
src/core/network-proxy.c
Normal file
30
src/core/network-proxy.c
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
/* --*- c -*--
|
||||
* Copyright (C) 2008 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 and/or 3 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "module.h"
|
||||
|
||||
#include "network-proxy.h"
|
||||
#include <string.h>
|
||||
|
||||
struct network_proxy *
|
||||
network_proxy_create(char const *type)
|
||||
{
|
||||
if (type==NULL)
|
||||
return NULL;
|
||||
|
||||
g_error("unsupported proxy type '%s'", type);
|
||||
return NULL;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue