GObject.Object
Soup.Server
Import line: | Soup = imports.gi.Soup; |
GIR File: | Soup-2.4.gir |
C documentation: | SoupServer |
Class : | Server |
Extends: | GObject.Object |
Properties | Defined By | |
---|---|---|
async_context : void*
|
Soup.Server | |
interface : Soup.Address
|
Soup.Server | |
parent : GObject.Object
read only
|
Soup.Server | |
port : guint32
|
Soup.Server | |
raw_paths : gboolean
|
Soup.Server | |
server_header : String
|
Soup.Server | |
ssl_cert_file : String
|
Soup.Server | |
ssl_key_file : String
|
Soup.Server |
Method / Constructor | Defined By | |
---|---|---|
new Soup.Server
(Object properties)
Create a new Soup.Server
Create a new Soup.Server
|
||
add_auth_domain
(AuthDomain auth_domain)
:
none
Adds an authentication domain to server.
Adds an authentication domain to server. Each auth domain will
have the chance to require authentication for each request that comes in; normally auth domains will require authentication for requests on certain paths that they have been set up to watch, or that meet other criteria set by the caller. If an auth domain determines that a request requires authentication (and the request doesn't contain authentication), server will automatically reject the request with an appropriate status (401 Unauthorized or 407 Proxy Authentication Required). If the request used the "100-continue" Expectation, server will reject it before the request body is sent.
|
Soup.Server | |
Adds a handler to server for requests under path.
Adds a handler to server for requests under path. See the
documentation for SoupServerCallback for information about how callbacks should behave. If path is NULL or "/", then this will be the default handler for all requests that don't have a more specific handler. Note though that if you want to handle requests to the special "*" URI, you must explicitly register a handler for "*"; the default handler will not be used for that case.
|
Soup.Server | |
disconnect
()
:
none
Stops processing for server and closes its socket.
Stops processing for server and closes its socket. This implies
the effects of soup_server_quit(), but additionally closes the listening socket. Note that messages currently in progress will continue to be handled, if the main loop associated with the server is resumed or kept running. After calling this function, server is no longer functional, so it has nearly the same effect as destroying server entirely. The function is thus useful mainly for language bindings without explicit control over object lifetime.
|
Soup.Server | |
get_async_context
()
:
GLib.MainContext
Gets server's async_context.
Gets server's async_context. This does not add a ref to the
context, so you will need to ref it yourself if you want it to outlive its server.
|
Soup.Server | |
get_listener
()
:
Soup.Socket
Gets server's listening socket.
Gets server's listening socket. You should treat this as
read-only; writing to it or modifiying it may cause server to malfunction.
|
Soup.Server | |
get_port
()
:
guint32
Gets the TCP port that server is listening on.
Gets the TCP port that server is listening on. This is most useful
when you did not request a specific port (or explicitly requested SOUP_ADDRESS_ANY_PORT).
|
Soup.Server | |
is_https
()
:
gboolean
Checks whether server is running plain http or https.
Checks whether server is running plain http or https.
In order for a server to run https, you must set the SOUP_SERVER_SSL_CERT_FILE and SOUP_SERVER_SSL_KEY_FILE properties to provide it with an SSL certificate to use.
|
Soup.Server | |
pause_message
(Message msg)
:
none
Pauses I/O on msg.
Pauses I/O on msg. This can be used when you need to return from
the server handler without having the full response ready yet. Use soup_server_unpause_message() to resume I/O.
|
Soup.Server | |
quit
()
:
none
Stops processing for server.
Stops processing for server. Call this to clean up after
soup_server_run_async(), or to terminate a call to soup_server_run(). and stop a server as many times as you want.
|
Soup.Server | |
remove_auth_domain
(AuthDomain auth_domain)
:
none
Removes auth_domain from server.
Removes auth_domain from server.
|
Soup.Server | |
remove_handler
(String path)
:
none
Removes the handler registered at path.
Removes the handler registered at path.
|
Soup.Server | |
run
()
:
none
Starts server, causing it to listen for and process incoming
connections.
Starts server, causing it to listen for and process incoming
connections. Unlike soup_server_run_async(), this creates a GMainLoop and runs it, and it will not return until someone calls soup_server_quit() to stop the server.
|
Soup.Server | |
run_async
()
:
none
Starts server, causing it to listen for and process incoming
connections.
Starts server, causing it to listen for and process incoming
connections. The server actually runs in server's GMainContext. It will not actually perform any processing unless the appropriate main loop is running. In the simple case where you did not set the server's SOUP_SERVER_ASYNC_CONTEXT property, this means the server will run whenever the glib main loop is running.
|
Soup.Server | |
unpause_message
(Message msg)
:
none
Resumes I/O on msg.
Resumes I/O on msg. Use this to resume after calling
soup_server_pause_message(), or after adding a new chunk to a chunked response. I/O won't actually resume until you return to the main loop.
|
Soup.Server |
Event | Defined By | |
---|---|---|
|
Soup.Server | |
|
Soup.Server | |
|
Soup.Server | |
|
Soup.Server |