Changeset 34495 in project


Ignore:
Timestamp:
09/02/17 20:12:37 (3 weeks ago)
Author:
zbigniew
Message:

update phricken wiki for 1.2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/phricken

    r22875 r34495  
    2525==== Entries
    2626
    27 <procedure>(make-entry type name sel #!optional (host (host)) (port (port)))</procedure><br>
     27<procedure>(make-entry type name sel #!optional (host h) (port p))</procedure><br>
    2828<procedure>(make-info-entry . msg)</procedure><br>
    2929<procedure>(make-error-entry . msg)</procedure><br>
     
    332332
    333333<parameter>logger</parameter>
    334 <procedure>((logger) type req . msg)</procedure>
    335 <parameter>(logger-port (current-error-port))</parameter>
     334<procedure>(logger-impl type req . msg)</procedure>
     335<parameter>logger-port</parameter>
     336
     337The {{logger}} parameter specifies a logging procedure
     338conforming to the {{logger-impl}} interface.
    336339
    337340The default logger implementation logs a formatted message to
    338 {{(logger-port)}}, or skips logging if the port is {{#f}}.  No locking is
    339 performed.  Seeking to end is performed prior to writing, but it is
    340 recommended any file be opened in {{#:append}} mode.
    341 
    342 It is legal for {{REQ}} to be {{#f}} if a request has not yet been
     341{{(logger-port)}}, by default {{(current-error-port)}}, or skips logging if the
     342port is {{#f}}.  No locking is performed.  Seek to EOF is not done on write
     343because some ports do not support seeking; therefore, files should be opened in
     344append mode, as in {{(open-output-file file #:append)}}.
     345
     346It is legal for {{req}} to be {{#f}} if a request has not yet been
    343347created--for example, upon early error, or initial connect.
    344348
    345 TYPE can be any symbol; current types are {{'connect}}, {{'access}},
     349{{type}} can be any symbol; current types are {{'connect}}, {{'access}},
    346350{{'error}}, {{'redirect}}.  By default, types are not treated specially,
    347351just displayed in the log message.
    348352
    349 The {{logger}} parameter can be overridden to use your own logging
    350 procedure, as long as it implements the interface above.
    351 
    352353==== Miscellaneous parameters
    353354
    354 <parameter>(host (get-host-name))</parameter>
     355<parameter>host</parameter>
    355356<parameter>(port 70)</parameter>
    356357<parameter>(listen-address #f)</parameter>
     
    360361hostname and port, and port is used in {{start-server!}} to determine
    361362which port to listen on.  Note that {{host}} must be a DNS name
    362 which clients can resolve to reach your machine.
     363which clients can resolve to reach your machine. {{host}} defaults
     364to the value of {{(get-host-name)}}.
    363365
    364366{{listen-address}} is the IP address to listen on (bind to), as a
     
    367369{{client-ip}} is read-only; you can read it inside a handler to
    368370determine the IP address of the remote end.
     371
     372<parameter>(phricken-user #!optional user)</parameter>
     373<parameter>(phricken-group #!optional group)</parameter>
     374
     375{{start-server!}} will switch to the specified {{user}} and {{group}}
     376after opening the listen socket, allowing you to run unprivileged
     377while listening on a privileged port. If {{#f}}, the default,
     378then no switch is done.
    369379
    370380==== Finally, the server
     
    401411=== Version history
    402412
     413* 1.2 Avoid seek to EOF when logging; implement user and group switching (patches from Kooda)
    403414* 1.1 IPv6 support; {{listen-address}}
    404415* 1.0 Initial release
Note: See TracChangeset for help on using the changeset viewer.