forked from mbk-lab/rui_orig
Added the RemoteAddr function to Session interface
This commit is contained in:
parent
29164a2416
commit
7f7dcfb746
|
@ -33,8 +33,10 @@ type Session interface {
|
|||
Color(tag string) (Color, bool)
|
||||
// SetCustomTheme set the custom theme
|
||||
SetCustomTheme(name string) bool
|
||||
// UserAgent() returns the "user-agent" text of the client browser
|
||||
// UserAgent returns the "user-agent" text of the client browser
|
||||
UserAgent() string
|
||||
// RemoteAddr returns the client address.
|
||||
RemoteAddr() string
|
||||
// Language returns the current session language
|
||||
Language() string
|
||||
// SetLanguage set the current session language
|
||||
|
@ -430,3 +432,7 @@ func (session *sessionData) SetTitle(title string) {
|
|||
func (session *sessionData) SetTitleColor(color Color) {
|
||||
session.runScript(`setTitleColor("` + color.cssString() + `");`)
|
||||
}
|
||||
|
||||
func (session *sessionData) RemoteAddr() string {
|
||||
return session.brige.remoteAddr()
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ type WebBrige interface {
|
|||
RunGetterScript(script string) DataObject
|
||||
AnswerReceived(answer DataObject)
|
||||
Close()
|
||||
remoteAddr() string
|
||||
}
|
||||
|
||||
type wsBrige struct {
|
||||
|
@ -122,3 +123,7 @@ func (brige *wsBrige) AnswerReceived(answer DataObject) {
|
|||
ErrorLog("answerID not found")
|
||||
}
|
||||
}
|
||||
|
||||
func (brige *wsBrige) remoteAddr() string {
|
||||
return brige.conn.RemoteAddr().String()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue