proxy_info.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. // This file is part of BOINC.
  2. // http://boinc.berkeley.edu
  3. // Copyright (C) 2008 University of California
  4. //
  5. // BOINC is free software; you can redistribute it and/or modify it
  6. // under the terms of the GNU Lesser General Public License
  7. // as published by the Free Software Foundation,
  8. // either version 3 of the License, or (at your option) any later version.
  9. //
  10. // BOINC is distributed in the hope that it will be useful,
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. // See the GNU Lesser General Public License for more details.
  14. //
  15. // You should have received a copy of the GNU Lesser General Public License
  16. // along with BOINC. If not, see <http://www.gnu.org/licenses/>.
  17. #ifndef BOINC_PROXY_INFO_H
  18. #define BOINC_PROXY_INFO_H
  19. struct XML_PARSER;
  20. class MIOFILE;
  21. // info on whether HTTP requests need to go through a proxy
  22. //
  23. struct PROXY_INFO {
  24. bool present;
  25. // set if rest of structure is filled in
  26. // the following is populated if user has specified an HTTP proxy
  27. //
  28. bool use_http_proxy;
  29. bool use_http_auth;
  30. char http_server_name[256];
  31. int http_server_port;
  32. char http_user_name[256];
  33. char http_user_passwd[256];
  34. // the following is populated if user has specified a SOCKS proxy.
  35. // Only SOCKS 5 is supported.
  36. //
  37. bool use_socks_proxy;
  38. char socks_server_name[256];
  39. int socks_server_port;
  40. char socks5_user_name[256];
  41. char socks5_user_passwd[256];
  42. bool socks5_remote_dns;
  43. // send DNS requests to the proxy
  44. // a list of hosts for which we should NOT go through a proxy
  45. // (e.g. a company PC attached to both local and remote projects)
  46. //
  47. char noproxy_hosts[256];
  48. // don't autodetect proxy (Win)
  49. //
  50. bool no_autodetect;
  51. // On Windows, if neither HTTP nor SOCKS proxy is specified,
  52. // we try the "autodetect" mechanism.
  53. // If it gets anything, the info is filled in below
  54. //
  55. bool autodetect_proxy_supported;
  56. // if true, some mechanism for detecting proxy servers is
  57. // supported by the client.
  58. int autodetect_protocol;
  59. // URL_PROTOCOL_SOCKS, URL_PROTOCOL_HTTP, or URL_PROTOCOL_HTTPS
  60. char autodetect_server_name[256];
  61. int autodetect_port;
  62. bool need_autodetect_proxy_settings;
  63. // if true, we need to detect proxy settings.
  64. // set to true if ref web site lookup fails
  65. bool have_autodetect_proxy_settings;
  66. // whether above fields are defined
  67. PROXY_INFO() {
  68. clear();
  69. }
  70. int parse(XML_PARSER&);
  71. int parse_config(XML_PARSER&);
  72. int write(MIOFILE&);
  73. void clear();
  74. };
  75. #endif