Add support for and use socket host override. (#1682)
* Add support for and use socket host override. Closes #1378 * Fix embeds with the new websocket constructor
This commit is contained in:
@@ -408,6 +408,25 @@ func SetServerURL(w http.ResponseWriter, r *http.Request) {
|
||||
controllers.WriteSimpleResponse(w, true, "server url set")
|
||||
}
|
||||
|
||||
// SetSocketHostOverride will set the host override for the websocket.
|
||||
func SetSocketHostOverride(w http.ResponseWriter, r *http.Request) {
|
||||
if !requirePOST(w, r) {
|
||||
return
|
||||
}
|
||||
|
||||
configValue, success := getValueFromRequest(w, r)
|
||||
if !success {
|
||||
return
|
||||
}
|
||||
|
||||
if err := data.SetWebsocketOverrideHost(configValue.Value.(string)); err != nil {
|
||||
controllers.WriteSimpleResponse(w, false, err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
controllers.WriteSimpleResponse(w, true, "websocket host override set")
|
||||
}
|
||||
|
||||
// SetDirectoryEnabled will handle the web config request to enable or disable directory registration.
|
||||
func SetDirectoryEnabled(w http.ResponseWriter, r *http.Request) {
|
||||
if !requirePOST(w, r) {
|
||||
|
||||
@@ -53,6 +53,7 @@ func GetServerConfig(w http.ResponseWriter, r *http.Request) {
|
||||
RTMPServerPort: data.GetRTMPPortNumber(),
|
||||
ChatDisabled: data.GetChatDisabled(),
|
||||
ChatJoinMessagesEnabled: data.GetChatJoinMessagesEnabled(),
|
||||
SocketHostOverride: data.GetWebsocketOverrideHost(),
|
||||
VideoSettings: videoSettings{
|
||||
VideoQualityVariants: videoQualityVariants,
|
||||
LatencyLevel: data.GetStreamLatencyLevel().Level,
|
||||
@@ -103,6 +104,7 @@ type serverConfigAdminResponse struct {
|
||||
ForbiddenUsernames []string `json:"forbiddenUsernames"`
|
||||
Federation federationConfigResponse `json:"federation"`
|
||||
SuggestedUsernames []string `json:"suggestedUsernames"`
|
||||
SocketHostOverride string `json:"socketHostOverride,omitempty"`
|
||||
}
|
||||
|
||||
type videoSettings struct {
|
||||
|
||||
Reference in New Issue
Block a user