@@ -35,6 +35,11 @@ public class SplitClientConfig {
3535 public static final String STREAMING_ENDPOINT = "https://streaming.split.io/sse" ;
3636 public static final String TELEMETRY_ENDPOINT = "https://telemetry.split.io/api/v1" ;
3737
38+ public static class HttpScheme {
39+ public static final String HTTP = "http" ;
40+ public static final String HTTPS = "https" ;
41+ }
42+
3843 private final String _endpoint ;
3944 private final String _eventsEndpoint ;
4045
@@ -455,6 +460,7 @@ public static final class Builder {
455460 private int _waitBeforeShutdown = 5000 ;
456461 private String _proxyHost = "localhost" ;
457462 private int _proxyPort = -1 ;
463+ private String _proxyScheme = HttpScheme .HTTP ;
458464 private String _proxyUsername ;
459465 private String _proxyPassword ;
460466 private String _proxyToken ;
@@ -771,6 +777,17 @@ public Builder proxyPort(int proxyPort) {
771777 return this ;
772778 }
773779
780+ /**
781+ * The http scheme of the proxy. Default is http.
782+ *
783+ * @param proxyScheme protocol for the proxy
784+ * @return this builder
785+ */
786+ public Builder proxyScheme (String proxyScheme ) {
787+ _proxyScheme = proxyScheme ;
788+ return this ;
789+ }
790+
774791 /**
775792 * Set the username for authentication against the proxy (if proxy settings are enabled). (Optional).
776793 *
@@ -827,7 +844,7 @@ public Builder disableDestroyOnShutDown() {
827844
828845 HttpHost proxy () {
829846 if (_proxyPort != -1 ) {
830- return new HttpHost (_proxyHost , _proxyPort );
847+ return new HttpHost (_proxyScheme , _proxyHost , _proxyPort );
831848 }
832849 // Default is no proxy.
833850 return null ;
@@ -1140,6 +1157,10 @@ private void verifyProxy() {
11401157 return ;
11411158 }
11421159
1160+ if (!(_proxyScheme .equals (HttpScheme .HTTP ) || _proxyScheme .equals (HttpScheme .HTTPS ))) {
1161+ throw new IllegalArgumentException ("Proxy scheme must be either http or https." );
1162+ }
1163+
11431164 if (_proxyUsername == null && _proxyToken == null && _proxyMtlsAuth == null ) {
11441165 return ;
11451166 }
0 commit comments