@@ -36,7 +36,13 @@ class Config{
36
36
"ip " => "127.0.0.1 " , // The IP (if on something different to the one in the config)
37
37
"fivemPort " => "30120 " , // The fivem port
38
38
"socketPort " => "30121 " , // Set to the port that you set in the "socket_port" convar (if different to the one in the config)
39
- "liveMapName " => "live_map " // Set to the resource's name (if different to the one in the config)
39
+ "liveMapName " => "live_map " , // Set to the resource's name (if different to the one in the config)
40
+
41
+ "reverseProxy " => array (
42
+ "socketUrl " => "wss://some.server " , // If we have a revers proxy server over at some.server that connects to the insecure fivemserver
43
+ "blipUrl " => "https://some.server/some_blips.json "
44
+ )
45
+
40
46
)
41
47
);
42
48
// These values will only be used if, the array doesn't contain it's values.
@@ -53,6 +59,9 @@ class Config{
53
59
// Note: If you change the folder name on the GTA server you NEED to change this
54
60
public $ liveMapName = "live_map " ;
55
61
62
+ // If you run a reverse proxy, this will be a little easier for you to point it to it.
63
+ public $ reverseProxy = array ();
64
+
56
65
// These will be injected into the JS code to configure how the map works
57
66
58
67
// The directory that contains the folders for the map tiles. Can be relative or, full URL..
@@ -102,7 +111,7 @@ public function gtaServer(){
102
111
* @return string The URL used to connect to the websocket server (e.g. "ws://127.0.0.1:30121")
103
112
*/
104
113
public function socketUrl (){
105
- return "ws:// $ this ->fivemIP : $ this ->socketPort / " ;
114
+ return array_key_exists ( " socketUrl " , $ this -> reverseProxy ) ? $ this -> reverseProxy [ " socketUrl " ] : "ws:// $ this ->fivemIP : $ this ->socketPort / " ;
106
115
}
107
116
108
117
/**
@@ -111,7 +120,7 @@ public function socketUrl(){
111
120
* @return string The URL you can use to get the blips file (e.g. "http://127.0.0.1:30120/live_map/blips.json")
112
121
*/
113
122
public function blipUrl (){
114
- return $ this ->gtaServer () . $ this ->liveMapName . "/blips.json " ;
123
+ return array_key_exists ( " blipUrl " , $ this -> reverseProxy ) ? $ this -> reverseProxy [ " blipUrl " ] : $ this ->gtaServer () . $ this ->liveMapName . "/blips.json " ;
115
124
}
116
125
117
126
private static $ instance = NULL ;
0 commit comments