实现回源跟随功能

This commit is contained in:
刘祥超
2022-03-14 15:07:49 +08:00
parent 46d38ff8c0
commit 8c6e960db7
6 changed files with 14 additions and 1 deletions

View File

@@ -106,6 +106,7 @@ func (this *SettingAction) RunPost(params struct {
StripPrefix: reverseProxyConfig.StripPrefix, StripPrefix: reverseProxyConfig.StripPrefix,
AutoFlush: reverseProxyConfig.AutoFlush, AutoFlush: reverseProxyConfig.AutoFlush,
AddHeaders: reverseProxyConfig.AddHeaders, AddHeaders: reverseProxyConfig.AddHeaders,
FollowRedirects: reverseProxyConfig.FollowRedirects,
ProxyProtocolJSON: proxyProtocolJSON, ProxyProtocolJSON: proxyProtocolJSON,
}) })

View File

@@ -106,6 +106,7 @@ func (this *SettingAction) RunPost(params struct {
StripPrefix: reverseProxyConfig.StripPrefix, StripPrefix: reverseProxyConfig.StripPrefix,
AutoFlush: reverseProxyConfig.AutoFlush, AutoFlush: reverseProxyConfig.AutoFlush,
AddHeaders: reverseProxyConfig.AddHeaders, AddHeaders: reverseProxyConfig.AddHeaders,
FollowRedirects: reverseProxyConfig.FollowRedirects,
ProxyProtocolJSON: proxyProtocolJSON, ProxyProtocolJSON: proxyProtocolJSON,
}) })

View File

@@ -96,6 +96,7 @@ func (this *SettingAction) RunPost(params struct {
StripPrefix: reverseProxyConfig.StripPrefix, StripPrefix: reverseProxyConfig.StripPrefix,
AutoFlush: reverseProxyConfig.AutoFlush, AutoFlush: reverseProxyConfig.AutoFlush,
AddHeaders: reverseProxyConfig.AddHeaders, AddHeaders: reverseProxyConfig.AddHeaders,
FollowRedirects: reverseProxyConfig.FollowRedirects,
}) })
this.Success() this.Success()

View File

@@ -97,6 +97,7 @@ func (this *SettingAction) RunPost(params struct {
StripPrefix: reverseProxyConfig.StripPrefix, StripPrefix: reverseProxyConfig.StripPrefix,
AutoFlush: reverseProxyConfig.AutoFlush, AutoFlush: reverseProxyConfig.AutoFlush,
AddHeaders: reverseProxyConfig.AddHeaders, AddHeaders: reverseProxyConfig.AddHeaders,
FollowRedirects: reverseProxyConfig.FollowRedirects,
ProxyProtocolJSON: proxyProtocolJSON, ProxyProtocolJSON: proxyProtocolJSON,
}) })

View File

@@ -131,6 +131,7 @@ func (this *SettingAction) RunPost(params struct {
MaxConns: types.Int32(reverseProxyConfig.MaxConns), MaxConns: types.Int32(reverseProxyConfig.MaxConns),
MaxIdleConns: types.Int32(reverseProxyConfig.MaxIdleConns), MaxIdleConns: types.Int32(reverseProxyConfig.MaxIdleConns),
ProxyProtocolJSON: proxyProtocolJSON, ProxyProtocolJSON: proxyProtocolJSON,
FollowRedirects: reverseProxyConfig.FollowRedirects,
}) })
if err != nil { if err != nil {
this.ErrorPage(err) this.ErrorPage(err)

View File

@@ -23,7 +23,8 @@ Vue.component("reverse-proxy-box", {
readTimeout: {count: 0, unit: "second"}, readTimeout: {count: 0, unit: "second"},
idleTimeout: {count: 0, unit: "second"}, idleTimeout: {count: 0, unit: "second"},
maxConns: 0, maxConns: 0,
maxIdleConns: 0 maxIdleConns: 0,
followRedirects: false
} }
} }
if (reverseProxyConfig.addHeaders == null) { if (reverseProxyConfig.addHeaders == null) {
@@ -183,6 +184,13 @@ Vue.component("reverse-proxy-box", {
</tbody> </tbody>
<more-options-tbody @change="changeAdvancedVisible" v-if="isOn()"></more-options-tbody> <more-options-tbody @change="changeAdvancedVisible" v-if="isOn()"></more-options-tbody>
<tbody v-show="isOn() && advancedVisible"> <tbody v-show="isOn() && advancedVisible">
<tr v-show="family == null || family == 'http'">
<td>回源跟随</td>
<td>
<checkbox v-model="reverseProxyConfig.followRedirects"></checkbox>
<p class="comment">选中后,自动读取源站跳转后的网页内容。</p>
</td>
</tr>
<tr v-show="family == null || family == 'http'"> <tr v-show="family == null || family == 'http'">
<td>自动添加的Header</td> <td>自动添加的Header</td>
<td> <td>