Project

General

Profile

Feature #2060

mod_connect

Added by jmberg over 7 years ago. Updated 11 months ago.

Status:
New
Priority:
Low
Assignee:
-
Category:
3rd party
Target version:
-
Start date:
2009-09-01
Due date:
% Done:

0%

Missing in 1.5.x:

Description

The attached code will add support for CONNECT requests, as such:

CONNECT foo.bar.example.com:443 HTTP/1.0

etc. It supports being configured to allow only certain hosts, ports, combinations. Additionally, it allows configuring paths, so that

CONNECT /path HTTP/1.0

goes to a certain pre-defined host/port. This is the use case that I currently need. When this is used, it is also possible to ask lighttpd to not send a 200 OK response so that the backend server can do that if it's prepared to -- this allows it to control the response header.

Its error handling sucks, and the entire architecture might not be very clean, comments appreciated.

This patch is against 1.4.x, it doesn't seem to apply on a newer version but that can be solved I suppose.

mod-connect.patch View (27.5 KB) jmberg, 2009-09-01 09:46

History

#1 Updated by jmberg over 7 years ago

Since the patch viewer doesn't show the patch header, here's an example config:

connect.server          = (
    # finger kernel.org
    "/FINGER" => ( "host" => "204.152.191.37", "port" => 79 ),

    # connect to local echo server
    "/ECHO1" => ( "host" => "127.0.0.1", "port" => 7 ),

    # connect to local echo server, omit 200 response
    # the idea is that the server (echo doesn't of course)
    # will generate the 200 response to have control over it.
    "/ECHO2" => ( "host" => "127.0.0.1", "port" => 7, "noresponse" => 1 ),

    # connect to sipsolutions.net web server
    "/SIPS" => ( "host" => "83.246.72.84", "port" => 80 ),

    # w/o port: treat as http connection
    "83.246.72.84" => ( "port" => 80 ),

    # with any port: allow
    "83.246.72.84:*" => (),

    # allow connections anywhere to port 443
    "*:443" => (),
)

#2 Updated by gstrauss 11 months ago

  • Category set to 3rd party

Also available in: Atom