@@ -15,7 +15,7 @@ defmodule Mint.TunnelProxyTest do
1515
1616 assert { :ok , conn } =
1717 Mint.TunnelProxy . connect (
18- { :http , "localhost" , 8888 , [ ] } ,
18+ { :http , "localhost" , HttpBin . proxy_port ( ) , [ ] } ,
1919 { :http , HttpBin . proxy_host ( ) , HttpBin . http_port ( ) , [ ] }
2020 )
2121
@@ -37,7 +37,7 @@ defmodule Mint.TunnelProxyTest do
3737 test "200 response - https://httpbin.org" do
3838 assert { :ok , conn } =
3939 Mint.TunnelProxy . connect (
40- { :http , "localhost" , 8888 , [ ] } ,
40+ { :http , "localhost" , HttpBin . proxy_port ( ) , [ ] } ,
4141 { :https , HttpBin . proxy_host ( ) , HttpBin . https_port ( ) ,
4242 transport_opts: HttpBin . https_transport_opts ( ) }
4343 )
@@ -55,7 +55,7 @@ defmodule Mint.TunnelProxyTest do
5555 test "407 response - proxy with missing authentication" do
5656 assert { :error , % Mint.HTTPError { reason: { :proxy , { :unexpected_status , 407 } } } } =
5757 Mint.HTTP . connect ( :https , HttpBin . proxy_host ( ) , HttpBin . https_port ( ) ,
58- proxy: { :http , "localhost" , 8889 , [ ] } ,
58+ proxy: { :http , "localhost" , HttpBin . proxy_auth_port ( ) , [ ] } ,
5959 transport_opts: HttpBin . https_transport_opts ( )
6060 )
6161 end
@@ -65,7 +65,7 @@ defmodule Mint.TunnelProxyTest do
6565
6666 assert { :error , % Mint.HTTPError { reason: { :proxy , { :unexpected_status , 401 } } } } =
6767 Mint.HTTP . connect ( :https , HttpBin . proxy_host ( ) , HttpBin . https_port ( ) ,
68- proxy: { :http , "localhost" , 8889 , [ ] } ,
68+ proxy: { :http , "localhost" , HttpBin . proxy_auth_port ( ) , [ ] } ,
6969 proxy_headers: [ { "proxy-authorization" , "basic #{ invalid_auth64 } " } ] ,
7070 transport_opts: HttpBin . https_transport_opts ( )
7171 )
@@ -76,7 +76,7 @@ defmodule Mint.TunnelProxyTest do
7676
7777 assert { :ok , conn } =
7878 Mint.HTTP . connect ( :https , HttpBin . proxy_host ( ) , HttpBin . https_port ( ) ,
79- proxy: { :http , "localhost" , 8889 , [ ] } ,
79+ proxy: { :http , "localhost" , HttpBin . proxy_auth_port ( ) , [ ] } ,
8080 proxy_headers: [ { "proxy-authorization" , "basic #{ auth64 } " } ] ,
8181 transport_opts: HttpBin . https_transport_opts ( )
8282 )
@@ -94,7 +94,7 @@ defmodule Mint.TunnelProxyTest do
9494 test "200 response with explicit http2 - https://httpbin.org" do
9595 assert { :ok , conn } =
9696 Mint.TunnelProxy . connect (
97- { :http , "localhost" , 8888 , [ ] } ,
97+ { :http , "localhost" , HttpBin . proxy_port ( ) , [ ] } ,
9898 { :https , HttpBin . proxy_host ( ) , HttpBin . https_port ( ) ,
9999 [ protocols: [ :http2 ] , transport_opts: HttpBin . https_transport_opts ( ) ] }
100100 )
@@ -117,7 +117,7 @@ defmodule Mint.TunnelProxyTest do
117117 test "200 response without explicit http2 - https://httpbin.org" do
118118 assert { :ok , conn } =
119119 Mint.TunnelProxy . connect (
120- { :http , "localhost" , 8888 , [ ] } ,
120+ { :http , "localhost" , HttpBin . proxy_port ( ) , [ ] } ,
121121 { :https , HttpBin . proxy_host ( ) , HttpBin . https_port ( ) ,
122122 [ protocols: [ :http1 , :http2 ] , transport_opts: HttpBin . https_transport_opts ( ) ] }
123123 )
@@ -141,7 +141,7 @@ defmodule Mint.TunnelProxyTest do
141141 test "do not support nested HTTPS connections - https://httpbin.org" do
142142 assert { :ok , conn } =
143143 Mint.TunnelProxy . connect (
144- { :https , "localhost" , 8888 , [ ] } ,
144+ { :https , "localhost" , HttpBin . proxy_port ( ) , [ ] } ,
145145 { :https , HttpBin . proxy_host ( ) , HttpBin . https_port ( ) ,
146146 [ transport_opts: HttpBin . https_transport_opts ( ) ] }
147147 )
0 commit comments