fixes for buiding remote gaming server

This commit is contained in:
2023-03-01 17:15:41 +00:00
parent 6f9d3dd345
commit c88b4343ce
6 changed files with 16 additions and 3 deletions

View File

@@ -35,7 +35,9 @@ func BroadcastServerToBackend() error {
var gameSession GameSession
respIpv4orIPv6 := Ip4or6(config.IPAddress)
fmt.Println(config.IPAddress)
respIpv4orIPv6 := config.IPAddress
// Adding game session information
respIpv4orIPv6 = "https://" + respIpv4orIPv6

View File

@@ -25,7 +25,7 @@ func EscapeNAT(ScreenSharePort, GameplayServerPort string) (ServerPort string, S
}
// Get free port from P2PRC server node
ScreensharePort, err = frp.GetFRPServerPort("http://64.227.168.102:8088")
ScreensharePortFRP, err := frp.GetFRPServerPort("http://64.227.168.102:8088")
if err != nil {
return
@@ -34,7 +34,7 @@ func EscapeNAT(ScreenSharePort, GameplayServerPort string) (ServerPort string, S
time.Sleep(1 * time.Second)
// port for the screenshare port
ScreensharePort, err = frp.StartFRPClientForServer("64.227.168.102", ScreensharePort, ScreenSharePort)
ScreensharePort, err = frp.StartFRPClientForServer("64.227.168.102", ScreensharePortFRP, ScreenSharePort)
if err != nil {
return
}

View File

@@ -7,6 +7,7 @@ import (
"github.com/gorilla/websocket"
"io/ioutil"
"os"
"time"
)
type Room struct {
@@ -112,6 +113,7 @@ func (room *Room) writeToFile() error {
// ReadRoomsFile Reads rooms file and return struct room id
func ReadRoomsFile() (*Room, error) {
time.Sleep(3 * time.Second)
config, err := config.ConfigInit()
if err != nil {
return nil, err

View File

@@ -1,6 +1,7 @@
package core
import (
"crypto/tls"
"fmt"
"github.com/Akilan1999/remotegameplay/config"
"github.com/gorilla/websocket"
@@ -35,6 +36,7 @@ func sendHeartBeatWS(ticker *time.Ticker, conn *websocket.Conn, quit chan struct
}
func GetHttp() *http.ServeMux {
http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
server := http.NewServeMux()
server.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("files/static"))))