{"id":827,"date":"2019-11-07T16:59:10","date_gmt":"2019-11-07T21:59:10","guid":{"rendered":"https:\/\/www.bu.edu\/engit\/?page_id=827"},"modified":"2020-12-23T12:22:56","modified_gmt":"2020-12-23T17:22:56","slug":"bu-web-proxy","status":"publish","type":"page","link":"https:\/\/www.bu.edu\/engit\/knowledge-base\/bu-web-proxy\/","title":{"rendered":"BU Web Proxy"},"content":{"rendered":"<p>Commonly the proxy is set using service specific environmental variables. Here are examples for BU.<\/p>\n<h2 id=\"A.2BAC8-etc.2BAC8-environment\">\/etc\/environment<\/h2>\n<p>Environment variables can be set system-wide, regardless of the shell used, via <strong>\/etc\/environment<\/strong>. The <strong>\/etc\/environment<\/strong> file is read by pam_env.so during login, so only works with PAM logins. It doesn&#8217;t use export or support expanding existing variables, so setting PATH=$PATH:\/something will result in the literal string &#8220;$PATH&#8221; appearing in your PATH.<\/p>\n<pre class=\"darkSnippet\">http_proxy=\"http:\/\/webproxy.bu.edu:8900\"\r\nhttps_proxy=\"http:\/\/webproxy.bu.edu:8900\"\r\nftp_proxy=\"http:\/\/webproxy.bu.edu:8900\"\r\nrsync_proxy=\"http:\/\/webproxy.bu.edu:8900\"\r\nno_proxy=\"localhost,127.0.0.1,.bu.edu,.ad.bu.edu,128.197.,10.\"<\/pre>\n<h2 id=\"BashEnvironment\">Bash Environment<\/h2>\n<pre class=\"darkSnippet\">export http_proxy=\"http:\/\/webproxy.bu.edu:8900\"\r\nexport https_proxy=\"http:\/\/webproxy.bu.edu:8900\"\r\nexport ftp_proxy=\"http:\/\/webproxy.bu.edu:8900\"\r\nexport rsync_proxy=$http_proxy\r\nexport no_proxy=\"localhost,127.0.0.1,.bu.edu,.ad.bu.edu,128.197.,10.\"<\/pre>\n<p>Or all in one line:<\/p>\n<pre class=\"darkSnippet\">export {http,https,ftp,rsync}_proxy=\"http:\/\/webproxy.bu.edu:8900\"\r\nexport no_proxy=\"localhost,127.0.0.1,.bu.edu,.ad.bu.edu,128.197.,10.\"<\/pre>\n<p>There&#8217;s also:<\/p>\n<pre class=\"darkSnippet\">export dns_proxy=$http_proxy<\/pre>\n<p>but don&#8217;t use it.<\/p>\n<p>You can place these in <strong>.bashrc<\/strong>, <strong>.profile<\/strong>, <strong>\/etc\/profile<\/strong>, \/etc\/profile.d\/proxy.sh, or <a class=\"http\" href=\"http:\/\/stefaanlippens.net\/bashrc_and_others\/\">whatever fits<\/a>.<\/p>\n<h2 id=\"wget\">wget<\/h2>\n<p>Edit <strong>~\/.wgetrc<\/strong> file for personal settings or <strong>\/etc\/wgetrc<\/strong> for system wide settings:<\/p>\n<pre class=\"darkSnippet\">use_proxy=yes\r\nhttp_proxy=webproxy.bu.edu:8900\r\nhttps_proxy=webproxy.bu.edu:8900\r\nftp_proxy=webproxy.bu.edu:8900<\/pre>\n<p>or via -e options placed after the URL:<\/p>\n<pre class=\"darkSnippet\">wget ... -e use_proxy=yes -e http_proxy=webproxy.bu.edu:8900 ...<\/pre>\n<h2 id=\"cURL\">cURL<\/h2>\n<p>From the command line:<\/p>\n<pre class=\"darkSnippet\">curl -x http:\/\/webproxy.bu.edu:8900 -L http:\/\/url<\/pre>\n<h2 id=\"yum\">yum<\/h2>\n<p>You may want to add this line to <strong>\/etc\/yum.conf<\/strong>:<\/p>\n<pre class=\"darkSnippet\">proxy=http:\/\/webproxy.bu.edu:8900<\/pre>\n<h2 id=\"yum\">apt<\/h2>\n<p>You may want to add this line to <strong>\/etc\/apt\/apt.conf.d\/proxy.conf<\/strong>:<\/p>\n<pre class=\"darkSnippet\">Acquire {\r\n  HTTP::proxy \"http:\/\/webproxy.bu.edu:8900\";\r\n  HTTPS::proxy \"http:\/\/webproxy.bu.edu:8900\";\r\n}\r\n<\/pre>\n<p>&nbsp;<\/p>\n<h1 id=\"WindowsServer2012.2BAC8-2016\">Windows Server 2012\/2016<\/h1>\n<p>There are 2 proxy setting for Windows. One for the browswer and one for the OS. You can set the proxy for the OS directly with<\/p>\n<pre class=\"darkSnippet\">netsh winhttp set proxy webproxy.bu.edu:8900<\/pre>\n<p>or steal it from the browser&#8217;s Web Settings:<\/p>\n<pre class=\"darkSnippet\">netsh winhttp import proxy source=ie<\/pre>\n<p>You can also bypass the proxy for local sites:<\/p>\n<pre class=\"darkSnippet\">netsh winhttp set proxy proxy-server=\"webproxy.bu.edu:8900\" bypass-list=\"*.ad.bu.edu;*.bu.edu;localhost\"<\/pre>\n<p>Also useful:<\/p>\n<pre class=\"darkSnippet\">netsh winhttp reset proxy\r\nnetsh winhttp show proxy\r\n<\/pre>\n<p>More reading:<br \/>\n<a href=\"https:\/\/parsiya.net\/blog\/2017-10-08-thick-client-proxying---part-8---notes-on-proxying-windows-services\/\">https:\/\/parsiya.net\/blog\/2017-10-08-thick-client-proxying&#8212;part-8&#8212;notes-on-proxying-windows-services\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Commonly the proxy is set using service specific environmental variables. Here are examples for BU. \/etc\/environment Environment variables can be set system-wide, regardless of the shell used, via \/etc\/environment. The \/etc\/environment file is read by pam_env.so during login, so only works with PAM logins. It doesn&#8217;t use export or support expanding existing variables, so setting [&hellip;]<\/p>\n","protected":false},"author":1470,"featured_media":0,"parent":82,"menu_order":3,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/www.bu.edu\/engit\/wp-json\/wp\/v2\/pages\/827"}],"collection":[{"href":"https:\/\/www.bu.edu\/engit\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.bu.edu\/engit\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/engit\/wp-json\/wp\/v2\/users\/1470"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/engit\/wp-json\/wp\/v2\/comments?post=827"}],"version-history":[{"count":20,"href":"https:\/\/www.bu.edu\/engit\/wp-json\/wp\/v2\/pages\/827\/revisions"}],"predecessor-version":[{"id":835,"href":"https:\/\/www.bu.edu\/engit\/wp-json\/wp\/v2\/pages\/827\/revisions\/835"}],"up":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/engit\/wp-json\/wp\/v2\/pages\/82"}],"wp:attachment":[{"href":"https:\/\/www.bu.edu\/engit\/wp-json\/wp\/v2\/media?parent=827"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}