1
0

ne_session_proxy.3 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. '\" t
  2. .\" Title: ne_session_proxy
  3. .\" Author:
  4. .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
  5. .\" Date: 21 January 2023
  6. .\" Manual: neon API reference
  7. .\" Source: neon 0.32.5
  8. .\" Language: English
  9. .\"
  10. .TH "NE_SESSION_PROXY" "3" "21 January 2023" "neon 0.32.5" "neon API reference"
  11. .\" -----------------------------------------------------------------
  12. .\" * Define some portability stuff
  13. .\" -----------------------------------------------------------------
  14. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  15. .\" http://bugs.debian.org/507673
  16. .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
  17. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  18. .ie \n(.g .ds Aq \(aq
  19. .el .ds Aq '
  20. .\" -----------------------------------------------------------------
  21. .\" * set default formatting
  22. .\" -----------------------------------------------------------------
  23. .\" disable hyphenation
  24. .nh
  25. .\" disable justification (adjust text to left margin only)
  26. .ad l
  27. .\" -----------------------------------------------------------------
  28. .\" * MAIN CONTENT STARTS HERE *
  29. .\" -----------------------------------------------------------------
  30. .SH "NAME"
  31. ne_session_proxy, ne_session_socks_proxy, ne_session_system_proxy, ne_set_addrlist \- configure proxy servers
  32. .SH "SYNOPSIS"
  33. .sp
  34. .ft B
  35. .nf
  36. #include <ne_session\&.h>
  37. .fi
  38. .ft
  39. .HP \w'void\ ne_session_proxy('u
  40. .BI "void ne_session_proxy(ne_session\ *" "session" ", const\ char\ *" "hostname" ", unsigned\ int\ " "port" ");"
  41. .HP \w'void\ ne_session_system_proxy('u
  42. .BI "void ne_session_system_proxy(ne_session\ *" "session" ", unsigned\ int\ " "flags" ");"
  43. .HP \w'void\ ne_session_socks_proxy('u
  44. .BI "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" ");"
  45. .HP \w'void\ ne_set_addrlist('u
  46. .BI "void ne_set_addrlist(ne_session\ *" "session" ", const\ ne_inet_addr\ **" "addrlist" ", size_t\ " "count" ");"
  47. .SH "DESCRIPTION"
  48. .PP
  49. One (and no more than one) of the functions
  50. \fBne_session_proxy\fR,
  51. \fBne_session_system_proxy\fR,
  52. \fBne_session_socks_proxy\fR,
  53. \fBne_set_addrlist\fR
  54. can be used to configure a proxy server for a given session object\&. If more than one function is invoked for any given session object, only the last call has effect\&. If one of the functions is to be used, it must be used before the creation of any request object for the session\&.
  55. .SS "HTTP proxy specification"
  56. .PP
  57. The
  58. \fBne_session_proxy\fR
  59. function configures use of an HTTP proxy server for the session, the location of which is given by the
  60. \fIhostname\fR
  61. and
  62. \fIport\fR
  63. parameters\&. If the proxy requires authentication,
  64. ne_set_proxy_auth
  65. should be used\&.
  66. .SS "System proxy configuration"
  67. .PP
  68. The
  69. \fBne_session_system_proxy\fR
  70. 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\&.
  71. .SS "SOCKS proxy configuration"
  72. .PP
  73. The
  74. \fBne_session_socks_proxy\fR
  75. function configures the session to use a SOCKS proxy\&. The
  76. \fIversion\fR
  77. indicates which version of the SOCKS protocol should be used\&. The
  78. \fIhostname\fR
  79. and
  80. \fIport\fR
  81. parameters specify the SOCKS proxy location\&. Note that a server with only an IPv6 address cannot be used with SOCKS v4 or v4A\&. The interpretation of the other arguments depends on the version specified:
  82. .PP
  83. \fBNE_SOCK_SOCKSV4\fR (version 4)
  84. .RS 4
  85. The
  86. \fIusername\fR
  87. parameter must be non\-NULL; the
  88. \fIpassword\fR
  89. parameter is ignored\&.
  90. .RE
  91. .PP
  92. \fBNE_SOCK_SOCKSV4A\fR (version 4A)
  93. .RS 4
  94. The
  95. \fIusername\fR
  96. parameter must be non\-NULL; the
  97. \fIpassword\fR
  98. parameter is ignored\&.
  99. .RE
  100. .PP
  101. \fBNE_SOCK_SOCKSV5\fR (version 5)
  102. .RS 4
  103. The
  104. \fIusername\fR
  105. parameter may be
  106. NULL; if it is non\-NULL, the
  107. \fIpassword\fR
  108. parameter must also be non\-NULL; otherwise, it is ignored\&.\&.
  109. .RE
  110. .SS "Origin server address override"
  111. .PP
  112. The
  113. \fBne_set_addrlist\fR
  114. function forces use of an address and port the a specified list when establishing a TCP connection, ignoring the "real" hostname and port identifying the origin server for the session (as passed to
  115. \fBne_session_create\fR)\&. The origin server\*(Aqs "real" hostname and port will still be used in the
  116. Host
  117. header in HTTP requests\&. When a connection is required, the library will iterate through the
  118. \fIaddrlist\fR
  119. list, attempting to connect to the address
  120. \fIaddrlist[0]\fR
  121. through to
  122. \fIaddrlist[count\-1]\fR
  123. in turn, until a connection can be established\&.
  124. .SH "RETURN VALUES"
  125. .PP
  126. None of the functions described here has a return value\&.
  127. .SH "EXAMPLES"
  128. .PP
  129. Create and destroy a session:
  130. .sp
  131. .if n \{\
  132. .RS 4
  133. .\}
  134. .nf
  135. ne_session *sess;
  136. sess = ne_session_create("http", "host\&.example\&.com", 80);
  137. ne_session_proxy(sess, "proxy\&.example\&.com", 3128);
  138. /* \&.\&.\&. use sess \&.\&.\&. */
  139. ne_session_destroy(sess);
  140. .fi
  141. .if n \{\
  142. .RE
  143. .\}
  144. .SH "SEE ALSO"
  145. .PP
  146. ne_ssl_set_verify,
  147. ne_ssl_trust_cert,
  148. ne_sock_init,
  149. ne_set_session_flag
  150. .SH "AUTHOR"
  151. .PP
  152. \fBJoe Orton\fR
  153. .RS 4
  154. Author.
  155. .RE
  156. .SH "COPYRIGHT"
  157. .br