The hunchentoot-multi-acceptor Reference Manual

Next: , Previous: , Up: (dir)   [Contents][Index]

The hunchentoot-multi-acceptor Reference Manual

This is the hunchentoot-multi-acceptor Reference Manual, version 0.0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Thu Sep 15 05:04:18 2022 GMT+0.

Table of Contents


1 Introduction

hunchentoot-multi-acceptor

Arnold Noronha arnold@jipr.io

Typically each hunchentoot acceptor listens on a single port, and typically serves a single domain. A typical configuration is to have a frontend webserver like Nginx to route requests to the appropriate port.

This is hard to manage when the number of domains keep increasing (which is typical for small companies trying to iterate on different products). hunchentoot-multi-acceptor simplifies the configurations of such systems.

Installation

As an example, I personally run tdrhq.com (my personal website) and jipr.io (a project I'm working on.) These have two different hunchentoot acceptors:

(defvar *tdrhq-acceptor* (make-instance 'hunchentoot:easy-acceptor
                                         :port nil
                                         :name 'tdrhq))

(defvar *jipr-acceptor*
  (make-instance 'hunchentoot:easy-acceptor
                 :port nil
                 :name 'jipr))

These definitions could be in different packages and systems, it doesn't matter. Also the :port argument is useful when developing locally and want to test only one of the websites, but it won't be used by multi-acceptor.

Now, we have a multi-acceptor setup as follows:

(defparameter *multi-acceptor* (make-instance 'hunchentoot-multi-acceptor:multi-acceptor :port 4001 :name 'multi-acceptor))
(hunchentoot-multi-acceptor:add-acceptor *multi-acceptor* "tdrhq.com" *tdrhq-acceptor*)
(hunchentoot-multi-acceptor:add-acceptor *multi-acceptor* "www.jipr.io" *jipr-acceptor*)

(hunchentoot:start *multi-acceptor*)

At this point, you can configure your Nginx frontend for both websites to point to localhost:4001. Make sure the "Host" header is appropriately set. (proxy_set_header Host $host:$server_port). After that hunchentoot-multi-acceptor will take care of routing to the appropriate acceptor. Only one port will be opened.

License

Apache License, Version 2.0


2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 hunchentoot-multi-acceptor

Multiple domain support under single hunchentoot acceptor

Author

Arnold Noronha <arnold@jipr.io>

License

Apache License, Version 2.0

Version

0.0.1

Dependencies
  • hunchentoot (system).
  • usocket (system).
  • alexandria (system).
  • str (system).
Source

hunchentoot-multi-acceptor.asd.

Child Components

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


3.1.1 hunchentoot-multi-acceptor/hunchentoot-multi-acceptor.asd

Source

hunchentoot-multi-acceptor.asd.

Parent Component

hunchentoot-multi-acceptor (system).

ASDF Systems

hunchentoot-multi-acceptor.


3.1.3 hunchentoot-multi-acceptor/hunchentoot-multi-acceptor.lisp

Dependency

package.lisp (file).

Source

hunchentoot-multi-acceptor.asd.

Parent Component

hunchentoot-multi-acceptor (system).

Public Interface
Internals

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 hunchentoot-multi-acceptor

Source

package.lisp.

Use List
  • common-lisp.
  • hunchentoot.
Public Interface
Internals

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Public Interface


5.1.1 Special variables

Special Variable: *default-acceptor*
Package

hunchentoot-multi-acceptor.

Source

hunchentoot-multi-acceptor.lisp.


5.1.2 Ordinary functions

Function: add-acceptor (multi-acceptor host acceptor)
Package

hunchentoot-multi-acceptor.

Source

hunchentoot-multi-acceptor.lisp.


5.1.3 Generic functions

Generic Reader: listen-fd (object)
Package

hunchentoot-multi-acceptor.

Methods
Reader Method: listen-fd ((multi-acceptor multi-acceptor))

automatically generated reader method

Source

hunchentoot-multi-acceptor.lisp.

Target Slot

listen-fd.

Generic Writer: (setf listen-fd) (object)
Package

hunchentoot-multi-acceptor.

Methods
Writer Method: (setf listen-fd) ((multi-acceptor multi-acceptor))

automatically generated writer method

Source

hunchentoot-multi-acceptor.lisp.

Target Slot

listen-fd.


5.1.4 Standalone methods

Method: initialize-instance :after ((acceptor multi-acceptor) &key &allow-other-keys)
Source

hunchentoot-multi-acceptor.lisp.

Method: process-request ((request multi-request))
Package

hunchentoot.

Source

hunchentoot-multi-acceptor.lisp.

Method: start-listening ((acceptor multi-acceptor))
Package

hunchentoot.

Source

hunchentoot-multi-acceptor.lisp.


5.1.5 Classes

Class: multi-acceptor
Package

hunchentoot-multi-acceptor.

Source

hunchentoot-multi-acceptor.lisp.

Direct superclasses

acceptor.

Direct methods
Direct slots
Slot: sub-acceptors
Readers

sub-acceptors.

Writers

(setf sub-acceptors).

Slot: listen-fd
Initargs

:listen-fd

Readers

listen-fd.

Writers

(setf listen-fd).


5.2 Internals


Next: , Previous: , Up: Internals   [Contents][Index]

5.2.1 Ordinary functions

Function: copy-request (request acceptor)
Package

hunchentoot-multi-acceptor.

Source

hunchentoot-multi-acceptor.lisp.

Function: default-route (&key)
Package

hunchentoot-multi-acceptor.

Source

hunchentoot-multi-acceptor.lisp.

Function: listen-on-fd (fd &key element-type)
Package

hunchentoot-multi-acceptor.

Source

hunchentoot-multi-acceptor.lisp.


Next: , Previous: , Up: Internals   [Contents][Index]

5.2.2 Generic functions

Generic Reader: sub-acceptors (object)
Package

hunchentoot-multi-acceptor.

Methods
Reader Method: sub-acceptors ((multi-acceptor multi-acceptor))

automatically generated reader method

Source

hunchentoot-multi-acceptor.lisp.

Target Slot

sub-acceptors.

Generic Writer: (setf sub-acceptors) (object)
Package

hunchentoot-multi-acceptor.

Methods
Writer Method: (setf sub-acceptors) ((multi-acceptor multi-acceptor))

automatically generated writer method

Source

hunchentoot-multi-acceptor.lisp.

Target Slot

sub-acceptors.


Previous: , Up: Internals   [Contents][Index]

5.2.3 Classes

Class: multi-request
Package

hunchentoot-multi-acceptor.

Source

hunchentoot-multi-acceptor.lisp.

Direct superclasses

request.

Direct methods

process-request.


Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts


Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   (  
A   C   D   F   G   I   L   M   P   S  
Index Entry  Section

(
(setf listen-fd): Public generic functions
(setf listen-fd): Public generic functions
(setf sub-acceptors): Private generic functions
(setf sub-acceptors): Private generic functions

A
add-acceptor: Public ordinary functions

C
copy-request: Private ordinary functions

D
default-route: Private ordinary functions

F
Function, add-acceptor: Public ordinary functions
Function, copy-request: Private ordinary functions
Function, default-route: Private ordinary functions
Function, listen-on-fd: Private ordinary functions

G
Generic Function, (setf listen-fd): Public generic functions
Generic Function, (setf sub-acceptors): Private generic functions
Generic Function, listen-fd: Public generic functions
Generic Function, sub-acceptors: Private generic functions

I
initialize-instance: Public standalone methods

L
listen-fd: Public generic functions
listen-fd: Public generic functions
listen-on-fd: Private ordinary functions

M
Method, (setf listen-fd): Public generic functions
Method, (setf sub-acceptors): Private generic functions
Method, initialize-instance: Public standalone methods
Method, listen-fd: Public generic functions
Method, process-request: Public standalone methods
Method, start-listening: Public standalone methods
Method, sub-acceptors: Private generic functions

P
process-request: Public standalone methods

S
start-listening: Public standalone methods
sub-acceptors: Private generic functions
sub-acceptors: Private generic functions

Jump to:   (  
A   C   D   F   G   I   L   M   P   S