mirror of
https://github.com/giongto35/cloud-game.git
synced 2026-07-22 17:47:11 +00:00
Force update ws.js
This commit is contained in:
parent
102ce66fe0
commit
e0462326f4
2 changed files with 1 additions and 16 deletions
|
|
@ -253,21 +253,6 @@ func (o *Server) cleanConnection(client *WorkerClient, serverID string) {
|
|||
client.Close()
|
||||
}
|
||||
|
||||
func readUserIP(r *http.Request) string {
|
||||
IPAddress := r.Header.Get("X-Real-Ip")
|
||||
if IPAddress == "" {
|
||||
IPAddress = r.Header.Get("X-Forwarded-For")
|
||||
}
|
||||
if IPAddress == "" {
|
||||
IPAddress = r.RemoteAddr
|
||||
}
|
||||
// TODO: For debug, should remove it
|
||||
if IPAddress == "" {
|
||||
return "localhost"
|
||||
}
|
||||
return IPAddress
|
||||
}
|
||||
|
||||
func getRemoteAddress(conn *websocket.Conn) string {
|
||||
var remoteAddr string
|
||||
log.Println(conn.RemoteAddr().String())
|
||||
|
|
|
|||
2
static/game.html
vendored
2
static/game.html
vendored
|
|
@ -94,7 +94,7 @@
|
|||
<script src="/static/js/gesture_keyboard.js?1"></script>
|
||||
<script src="/static/js/gesture_touch.js?1"></script>
|
||||
<script src="/static/js/gesture_joystick.js?1"></script>
|
||||
<script src="/static/js/ws.js?1"></script>
|
||||
<script src="/static/js/ws.js?2"></script>
|
||||
|
||||
<script src="/static/js/init.js?1"></script>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue