Gjsify LogoGjsify Logo

Hierarchy

Index

Properties

acceptLanguage?: string

If non-%NULL, the value to use for the "Accept-Language" header on #SoupMessages sent from this session.

Setting this will disable #SoupSession:accept-language-auto.

acceptLanguageAuto?: boolean

If %TRUE, #SoupSession will automatically set the string for the "Accept-Language" header on every #SoupMessage sent, based on the return value of g_get_language_names().

Setting this will override any previous value of #SoupSession:accept-language.

asyncContext?: object

The #GMainContext that miscellaneous session-related asynchronous callbacks are invoked on. (Eg, setting #SoupSession:idle-timeout will add a timeout source on this context.)

For a plain #SoupSession, this property is always set to the #GMainContext that is the thread-default at the time the session was created, and cannot be overridden. For the deprecated #SoupSession subclasses, the default value is %NULL, meaning to use the global default #GMainContext.

If #SoupSession:use-thread-context is %FALSE, this context will also be used for asynchronous HTTP I/O.

httpAliases?: string[]

A %NULL-terminated array of URI schemes that should be considered to be aliases for "http". Eg, if this included "dav", than a URI of dav://example.com/path would be treated identically to http://example.com/path.

In a plain #SoupSession, the default value is %NULL, meaning that only "http" is recognized as meaning "http". In #SoupSessionAsync and #SoupSessionSync, for backward compatibility, the default value is an array containing the single element "*", a special value which means that any scheme except "https" is considered to be an alias for "http".

See also #SoupSession:https-aliases.

httpsAliases?: string[]

A comma-delimited list of URI schemes that should be considered to be aliases for "https". See #SoupSession:http-aliases for more information.

The default value is %NULL, meaning that no URI schemes are considered aliases for "https".

idleTimeout?: number

Connection lifetime (in seconds) when idle. Any connection left idle longer than this will be closed.

Although you can change this property at any time, it will only affect newly-created connections, not currently-open ones. You can call soup_session_abort() after setting this if you want to ensure that all future connections will have this timeout value.

Note that the default value of 60 seconds only applies to plain #SoupSessions. If you are using #SoupSessionAsync or #SoupSessionSync, the default value is 0 (meaning idle connections will never time out).

localAddress?: Soup.Address

Sets the #SoupAddress to use for the client side of the connection.

Use this property if you want for instance to bind the local socket to a specific IP address.

maxConns?: number
maxConnsPerHost?: number
proxyResolver?: Gio.ProxyResolver

A #GProxyResolver to use with this session. Setting this will clear the #SoupSession:proxy-uri property, and remove any SoupProxyURIResolver features that have been added to the session.

By default, in a plain #SoupSession, this is set to the default #GProxyResolver, but you can set it to %NULL if you don't want to use proxies, or set it to your own #GProxyResolver if you want to control what proxies get used.

proxyUri?: Soup.URI

A proxy to use for all http and https requests in this session. Setting this will clear the #SoupSession:proxy-resolver property, and remove any SoupProxyURIResolver features that have been added to the session. Setting this property will also cancel all currently pending messages.

Note that #SoupSession will normally handle looking up the user's proxy settings for you; you should only use #SoupSession:proxy-uri if you need to override the user's normal proxy settings.

Also note that this proxy will be used for all requests; even requests to localhost. If you need more control over proxies, you can create a #GSimpleProxyResolver and set the #SoupSession:proxy-resolver property.

sslCaFile?: string

File containing SSL CA certificates.

If the specified file does not exist or cannot be read, then libsoup will print a warning, and then behave as though it had read in a empty CA file, meaning that all SSL certificates will be considered invalid.

sslStrict?: boolean

Normally, if #SoupSession:tls-database is set (including if it was set via #SoupSession:ssl-use-system-ca-file or #SoupSession:ssl-ca-file), then libsoup will reject any certificate that is invalid (ie, expired) or that is not signed by one of the given CA certificates, and the #SoupMessage will fail with the status %SOUP_STATUS_SSL_FAILED.

If you set #SoupSession:ssl-strict to %FALSE, then all certificates will be accepted, and you will need to call soup_message_get_https_status() to distinguish valid from invalid certificates. (This can be used, eg, if you want to accept invalid certificates after giving some sort of warning.)

For a plain #SoupSession, if the session has no CA file or TLS database, and this property is %TRUE, then all certificates will be rejected. However, beware that the deprecated #SoupSession subclasses (#SoupSessionAsync and #SoupSessionSync) have the opposite behavior: if there is no CA file or TLS database, then all certificates are always accepted, and this property has no effect.

sslUseSystemCaFile?: boolean

Setting this to %TRUE is equivalent to setting #SoupSession:tls-database to the default system CA database. (and likewise, setting #SoupSession:tls-database to the default database by hand will cause this property to become %TRUE).

Setting this to %FALSE (when it was previously %TRUE) will clear the #SoupSession:tls-database field.

See #SoupSession:ssl-strict for more information on how https certificate validation is handled.

If you are using #SoupSessionAsync or #SoupSessionSync, on libsoup older than 2.74.0, the default value is %FALSE, for backward compatibility.

timeout?: number

The timeout (in seconds) for socket I/O operations (including connecting to a server, and waiting for a reply to an HTTP request).

Although you can change this property at any time, it will only affect newly-created connections, not currently-open ones. You can call soup_session_abort() after setting this if you want to ensure that all future connections will have this timeout value.

Note that the default value of 60 seconds only applies to plain #SoupSessions. If you are using #SoupSessionAsync or #SoupSessionSync, the default value is 0 (meaning socket I/O will not time out).

Not to be confused with #SoupSession:idle-timeout (which is the length of time that idle persistent connections will be kept open).

tlsDatabase?: TlsDatabase

Sets the #GTlsDatabase to use for validating SSL/TLS certificates.

Note that setting the #SoupSession:ssl-ca-file or #SoupSession:ssl-use-system-ca-file property will cause this property to be set to a #GTlsDatabase corresponding to the indicated file or system default.

See #SoupSession:ssl-strict for more information on how https certificate validation is handled.

If you are using a plain #SoupSession then #SoupSession:ssl-use-system-ca-file will be %TRUE by default, and so this property will be a copy of the system CA database. If you are using #SoupSessionAsync or #SoupSessionSync, on libsoup older than 2.74.0, this property will be %NULL by default.

tlsInteraction?: TlsInteraction

A #GTlsInteraction object that will be passed on to any #GTlsConnections created by the session. (This can be used to provide client-side certificates, for example.)

useNtlm?: boolean

Whether or not to use NTLM authentication.

useThreadContext?: boolean

If %TRUE (which it always is on a plain #SoupSession), asynchronous HTTP requests in this session will run in whatever the thread-default #GMainContext is at the time they are started, rather than always occurring in #SoupSession:async-context.

userAgent?: string

If non-%NULL, the value to use for the "User-Agent" header on #SoupMessages sent from this session.

RFC 2616 says: "The User-Agent request-header field contains information about the user agent originating the request. This is for statistical purposes, the tracing of protocol violations, and automated recognition of user agents for the sake of tailoring responses to avoid particular user agent limitations. User agents SHOULD include this field with requests."

The User-Agent header contains a list of one or more product tokens, separated by whitespace, with the most significant product token coming first. The tokens must be brief, ASCII, and mostly alphanumeric (although "-", "_", and "." are also allowed), and may optionally include a "/" followed by a version string. You may also put comments, enclosed in parentheses, between or after the tokens.

If you set a #SoupSession:user_agent property that has trailing whitespace, #SoupSession will append its own product token (eg, "libsoup/2.3.2") to the end of the header for you.

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method