![]() |
![]() |
![]() |
libsoup Reference Manual | ![]() |
---|---|---|---|---|
struct SoupServer; SoupServerContext; void (*SoupServerCallbackFn) (SoupServerContext *context, SoupMessage *msg, gpointer user_data); void (*SoupServerUnregisterFn) (SoupServer *server, SoupServerHandler *handler, gpointer user_data); SoupServer* soup_server_new (const char *optname1, ...); SoupProtocol soup_server_get_protocol (SoupServer *serv); guint soup_server_get_port (SoupServer *serv); SoupSocket* soup_server_get_listener (SoupServer *serv); void soup_server_run (SoupServer *serv); void soup_server_run_async (SoupServer *serv); void soup_server_quit (SoupServer *serv); typedef SoupServerHandler; void soup_server_add_handler (SoupServer *serv, const char *path, SoupServerAuthContext *auth_ctx, SoupServerCallbackFn callback, SoupServerUnregisterFn unreg, gpointer data); void soup_server_remove_handler (SoupServer *serv, const char *path); SoupServerHandler* soup_server_get_handler (SoupServer *serv, const char *path); GSList* soup_server_list_handlers (SoupServer *serv); SoupAddress* soup_server_context_get_client_address (SoupServerContext *ctx); const char* soup_server_context_get_client_host (SoupServerContext *ctx); #define SOUP_SERVER_PORT #define SOUP_SERVER_INTERFACE #define SOUP_SERVER_SSL_CERT_FILE #define SOUP_SERVER_SSL_KEY_FILE #define SOUP_SERVER_ASYNC_CONTEXT
"async-context" gpointer : Read / Write / Construct Only "interface" SoupAddress : Read / Write / Construct Only "port" guint : Read / Write / Construct Only "ssl-cert-file" gchararray : Read / Write / Construct Only "ssl-key-file" gchararray : Read / Write / Construct Only
SoupServer implements a simple HTTP server.
This API is less stable than the soup client API, and will most likely change in the next release.
typedef struct { SoupMessage *msg; char *path; SoupMethodId method_id; SoupServerAuth *auth; SoupServer *server; SoupServerHandler *handler; SoupSocket *sock; } SoupServerContext;
void (*SoupServerCallbackFn) (SoupServerContext *context, SoupMessage *msg, gpointer user_data);
|
|
|
|
|
void (*SoupServerUnregisterFn) (SoupServer *server, SoupServerHandler *handler, gpointer user_data);
|
|
|
|
|
SoupServer* soup_server_new (const char *optname1, ...);
|
|
|
|
Returns : |
SoupProtocol soup_server_get_protocol (SoupServer *serv);
|
|
Returns : |
SoupSocket* soup_server_get_listener (SoupServer *serv);
|
|
Returns : |
void soup_server_add_handler (SoupServer *serv, const char *path, SoupServerAuthContext *auth_ctx, SoupServerCallbackFn callback, SoupServerUnregisterFn unreg, gpointer data);
|
|
|
|
|
|
|
|
|
|
|
void soup_server_remove_handler (SoupServer *serv, const char *path);
|
|
|
SoupServerHandler* soup_server_get_handler (SoupServer *serv, const char *path);
|
|
|
|
Returns : |
SoupAddress* soup_server_context_get_client_address (SoupServerContext *ctx);
|
|
Returns : |
const char* soup_server_context_get_client_host (SoupServerContext *ctx);
|
|
Returns : |
#define SOUP_SERVER_INTERFACE "interface"
An alias for the "interface" property.
#define SOUP_SERVER_SSL_CERT_FILE "ssl-cert-file"
An alias for the "ssl-cert-file" property.
#define SOUP_SERVER_SSL_KEY_FILE "ssl-key-file"
An alias for the "ssl-key-file" property.
async-context
" property"async-context" gpointer : Read / Write / Construct Only
The GMainContext to dispatch async I/O in.
interface
" property"interface" SoupAddress : Read / Write / Construct Only
Address of interface to listen on.
port
" property"port" guint : Read / Write / Construct Only
Port to listen on.
Allowed values: <= 65536
Default value: 0
ssl-cert-file
" property"ssl-cert-file" gchararray : Read / Write / Construct Only
File containing server SSL certificate.
Default value: NULL
ssl-key-file
" property"ssl-key-file" gchararray : Read / Write / Construct Only
File containing server SSL key.
Default value: NULL