diff --git a/X-IPTV/UserLogin.xaml b/X-IPTV/UserLogin.xaml
index 15b8c9c..4dcbbf7 100644
--- a/X-IPTV/UserLogin.xaml
+++ b/X-IPTV/UserLogin.xaml
@@ -32,6 +32,8 @@ xmlns:xctw="clr-namespace:Xceed.Wpf.Toolkit.Themes.Windows10;assembly=Xceed.Wpf.
-
+
+
+
diff --git a/X-IPTV/UserLogin.xaml.cs b/X-IPTV/UserLogin.xaml.cs
index 6eedd62..ea7104e 100644
--- a/X-IPTV/UserLogin.xaml.cs
+++ b/X-IPTV/UserLogin.xaml.cs
@@ -47,7 +47,11 @@ private async void Con_btn_Click(object sender, RoutedEventArgs e)
private async Task Connect(string user, string pass, string server, string port)
{
// Create a request for the URL.
- WebRequest request = WebRequest.Create($"http://{server}:{port}/player_api.php?username={user}&password={pass}");
+ WebRequest request;
+ if ((bool)protocolCheckBox.IsChecked)//use the https protocol
+ request = WebRequest.Create($"https://{server}:{port}/player_api.php?username={user}&password={pass}");
+ else//use the http protocol
+ request = WebRequest.Create($"http://{server}:{port}/player_api.php?username={user}&password={pass}");
// If required by the server, set the credentials.
request.Credentials = CredentialCache.DefaultCredentials;
// Get the response.
@@ -75,8 +79,12 @@ private async Task Connect(string user, string pass, string server, string port)
private async Task LoadChannels(string user, string pass, string server, string port)
{
- // Create a request for the URL.
- WebRequest request = WebRequest.Create($"http://{server}:{port}/player_api.php?username={user}&password={pass}&action=get_live_streams");
+ // Create a request for the URL.
+ WebRequest request;
+ if ((bool)protocolCheckBox.IsChecked)//use the https protocol
+ request = WebRequest.Create($"https://{server}:{port}/player_api.php?username={user}&password={pass}&action=get_live_streams");
+ else//use the http protocol
+ request = WebRequest.Create($"http://{server}:{port}/player_api.php?username={user}&password={pass}&action=get_live_streams");
// If required by the server, set the credentials.
request.Credentials = CredentialCache.DefaultCredentials;
// Get the response.