C API Reference -- Ns_RegisterProxyRequest

### Ns_RegisterProxyRequest

#### Overview

Register a function to proxy requests for a method/protocol combination

#### Syntax

        typedef void *Ns_OpContext;
        typedef int (Ns_OpProc) (void *context, Ns_Conn *conn);
        typedef void (Ns_OpDeleteProc) (void *context);

        void Ns_RegisterProxyRequest(
        char        *Server,
        char        *method,
        char        *protocol,
        Ns_OpProc   *proc,
        Ns_Callback *deleteProc,
        void        *context
        );

#### Description

The Ns_RegisterProxyRequest function registers function proc to handle HTTP requests. When the specified server receives a proxy request, it finds the appropriate registered function.

The server passes your procedure the context you specify here and the Ns_Conn structure associated with the new HTTP connection.

When a procedure is unregistered with either Ns_UnRegisterProxyRequest, the server calls the deleteProc with the same context. You can use this to do any cleanup you might require (e.g., close an index file or free something from the heap). If the value of deleteProc is NULL, the server does nothing.

#### Examples

See the example in the examples/c/nsproxy directory.

Top of Page
Copyright © 1998-99 America Online, Inc.