added changes to allow https servers to broadcast availability

This commit is contained in:
2023-02-25 02:18:37 +00:00
parent 64d5774564
commit 7e07956e2b
2 changed files with 180 additions and 179 deletions

View File

@@ -1,6 +1,7 @@
package server
import (
"crypto/tls"
"fmt"
"github.com/gin-gonic/gin"
"gorm.io/gorm"
@@ -192,7 +193,6 @@ func Server(port string) error {
}
func CheckIfGameSessionIsActiveOrRemove(gorm *gorm.DB) {
fmt.Println("here")
for {
time.Sleep(2 * time.Second)
Gamesessions, err := DisplayGameSessions(gorm)
@@ -200,6 +200,7 @@ func CheckIfGameSessionIsActiveOrRemove(gorm *gorm.DB) {
return
}
http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
for i, _ := range Gamesessions {
req, err := http.NewRequest("GET", Gamesessions[i].Link, nil)
// Sending request to the backend server