NE_SESSION_PROXY(3)
okay bestie, welcome to NE_SESSION_PROXY(3) from the neon API reference β it's literally the proxy-config page and it's giving network setup main character energy πβ¨
π NAME π
ne_session_proxy, ne_session_socks_proxy, ne_session_system_proxy, ne_set_addrlist β configure proxy servers π
β¨ SYNOPSIS β¨
#include <ne_session.h>
void ne_session_proxy(ne_session *session, const char *hostname,
unsigned int port);
void ne_session_system_proxy(ne_session *session, unsigned int flags);
void ne_session_socks_proxy(ne_session *session,
enum ne_sock_sversion version,
const char *hostname, unsigned int port,
const char *username, const char *password);
void ne_set_addrlist(ne_session *session, const ne_inet_addr **addrlist,
size_t count);
πΈ DESCRIPTION πΈ
okay so here's the vibe: you get one β and no more than one β of these functions to configure a proxy server for a given session object: ne_session_proxy, ne_session_system_proxy, ne_session_socks_proxy, or ne_set_addrlist. If more than one function is invoked for any given session object, only the last call has effect. And if one of the functions is to be used, it must be used before the creation of any request object for the session. periodt π
The hostname parameter used with ne_session_proxy and ne_session_socks_proxy must follow the same rules as the host for ne_session_create; see ne_session_create(3) for examples.
π HTTP proxy specification
The ne_session_proxy function configures use of an HTTP proxy server for the session, the location of which is given by the hostname and port parameters. If the proxy requires authentication, ne_set_proxy_auth(3) should be used. π«Ά
π₯οΈ System proxy configuration
The ne_session_system_proxy function configures the session to use any proxy servers specified by the system configuration. Support for this function is platform-specific; if unsupported, the function has no effect. lowkey important, bestie β¨
𧦠SOCKS proxy configuration
The ne_session_socks_proxy function configures the session to use a SOCKS proxy. The version indicates which version of the SOCKS protocol should be used. The hostname and port parameters specify the SOCKS proxy location.
heads up: a server with only an IPv6 address cannot be used with SOCKS v4 or v4A. no cap π
The interpretation of the other arguments depends on the version specified:
NE_SOCK_SOCKSV4(version 4) β Theusernameparameter must be non-NULL; thepasswordparameter is ignored. π¦NE_SOCK_SOCKSV4A(version 4A) β Theusernameparameter must be non-NULL; thepasswordparameter is ignored. π¦NE_SOCK_SOCKSV5(version 5) β Theusernameparameter may beNULL; if it is non-NULL, thepasswordparameter must also be non-NULL; otherwise, it is ignored.. π₯
π― Origin server address override
The ne_set_addrlist function forces use of an address and port from the list you specify when establishing a TCP connection, ignoring the "real" hostname and port identifying the origin server for the session (as passed to ne_session_create).
The origin server's "real" hostname and port will still be used in the Host header in HTTP requests. When a connection is required, the library will iterate through the addrlist list, attempting to connect to the address addrlist[0] through to addrlist[count-1] in turn, until a connection can be established. obsessed with the persistence honestly π
π« RETURN VALUES π«
None of the functions described here has a return value. literally zero return values, bestie β that's the whole section π
π₯ EXAMPLES π₯
Create and destroy a session:
ne_session *sess;
sess = ne_session_create("http", "host.example.com", 80);
ne_session_proxy(sess, "proxy.example.com", 3128);
/* ... use sess ... */
ne_session_destroy(sess);
π¦ SEE ALSO π¦
π COPYRIGHT π
Copyright Β© 2001-2026 Joe Orton
byeee π«Ά β this page is from neon, dated 03/20/2026, and it's giving official docs realness π β¨
π¦ where this page comes from
- arch rolling: neon 0.37.1-1 Β· LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms