|
@@ -2648,9 +2648,9 @@ func (controller *Controller) runInproxyProxy() {
|
|
|
EnableWebRTCDebugLogging: debugLogging,
|
|
EnableWebRTCDebugLogging: debugLogging,
|
|
|
WaitForNetworkConnectivity: controller.inproxyWaitForNetworkConnectivity,
|
|
WaitForNetworkConnectivity: controller.inproxyWaitForNetworkConnectivity,
|
|
|
GetBrokerClient: controller.inproxyGetProxyBrokerClient,
|
|
GetBrokerClient: controller.inproxyGetProxyBrokerClient,
|
|
|
- GetBaseAPIParameters: controller.inproxyGetAPIParameters,
|
|
|
|
|
- MakeWebRTCDialCoordinator: controller.inproxyMakeWebRTCDialCoordinator,
|
|
|
|
|
- HandleTacticsPayload: controller.inproxyHandleTacticsPayload,
|
|
|
|
|
|
|
+ GetBaseAPIParameters: controller.inproxyGetProxyAPIParameters,
|
|
|
|
|
+ MakeWebRTCDialCoordinator: controller.inproxyMakeProxyWebRTCDialCoordinator,
|
|
|
|
|
+ HandleTacticsPayload: controller.inproxyHandleProxyTacticsPayload,
|
|
|
MaxClients: controller.config.InproxyMaxClients,
|
|
MaxClients: controller.config.InproxyMaxClients,
|
|
|
LimitUpstreamBytesPerSecond: controller.config.InproxyLimitUpstreamBytesPerSecond,
|
|
LimitUpstreamBytesPerSecond: controller.config.InproxyLimitUpstreamBytesPerSecond,
|
|
|
LimitDownstreamBytesPerSecond: controller.config.InproxyLimitDownstreamBytesPerSecond,
|
|
LimitDownstreamBytesPerSecond: controller.config.InproxyLimitDownstreamBytesPerSecond,
|
|
@@ -2729,27 +2729,28 @@ func (controller *Controller) inproxyGetProxyBrokerClient() (*inproxy.BrokerClie
|
|
|
return brokerClient, nil
|
|
return brokerClient, nil
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-func (controller *Controller) inproxyGetAPIParameters() (common.APIParameters, string, error) {
|
|
|
|
|
|
|
+func (controller *Controller) inproxyGetProxyAPIParameters() (
|
|
|
|
|
+ common.APIParameters, string, error) {
|
|
|
|
|
|
|
|
// TODO: include broker fronting dial parameters to be logged by the
|
|
// TODO: include broker fronting dial parameters to be logged by the
|
|
|
// broker.
|
|
// broker.
|
|
|
params := getBaseAPIParameters(baseParametersNoDialParameters, controller.config, nil)
|
|
params := getBaseAPIParameters(baseParametersNoDialParameters, controller.config, nil)
|
|
|
|
|
|
|
|
- networkID := controller.config.GetNetworkID()
|
|
|
|
|
- params["network_type"] = GetNetworkType(networkID)
|
|
|
|
|
-
|
|
|
|
|
if controller.config.DisableTactics {
|
|
if controller.config.DisableTactics {
|
|
|
return params, "", nil
|
|
return params, "", nil
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // Add the known tactics tag, so that the broker can return new tactics if
|
|
|
|
|
|
|
+ // Add the stored tactics tag, so that the broker can return new tactics if
|
|
|
// available.
|
|
// available.
|
|
|
//
|
|
//
|
|
|
// The active network ID is recorded returned and rechecked for
|
|
// The active network ID is recorded returned and rechecked for
|
|
|
// consistency when storing any new tactics returned from the broker;
|
|
// consistency when storing any new tactics returned from the broker;
|
|
|
// other tactics fetches have this same check.
|
|
// other tactics fetches have this same check.
|
|
|
|
|
|
|
|
- err := tactics.SetTacticsAPIParameters(GetTacticsStorer(controller.config), networkID, params)
|
|
|
|
|
|
|
+ networkID := controller.config.GetNetworkID()
|
|
|
|
|
+
|
|
|
|
|
+ err := tactics.SetTacticsAPIParameters(
|
|
|
|
|
+ GetTacticsStorer(controller.config), networkID, params)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
return nil, "", errors.Trace(err)
|
|
return nil, "", errors.Trace(err)
|
|
|
}
|
|
}
|
|
@@ -2757,7 +2758,8 @@ func (controller *Controller) inproxyGetAPIParameters() (common.APIParameters, s
|
|
|
return params, networkID, nil
|
|
return params, networkID, nil
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-func (controller *Controller) inproxyMakeWebRTCDialCoordinator() (inproxy.WebRTCDialCoordinator, error) {
|
|
|
|
|
|
|
+func (controller *Controller) inproxyMakeProxyWebRTCDialCoordinator() (
|
|
|
|
|
+ inproxy.WebRTCDialCoordinator, error) {
|
|
|
|
|
|
|
|
// nil is passed in for both InproxySTUNDialParameters and
|
|
// nil is passed in for both InproxySTUNDialParameters and
|
|
|
// InproxyWebRTCDialParameters, so those parameters will be newly
|
|
// InproxyWebRTCDialParameters, so those parameters will be newly
|
|
@@ -2780,12 +2782,12 @@ func (controller *Controller) inproxyMakeWebRTCDialCoordinator() (inproxy.WebRTC
|
|
|
return webRTCDialInstance, nil
|
|
return webRTCDialInstance, nil
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// inproxyHandleTacticsPayload handles new tactics returned from the proxy and
|
|
|
|
|
-// returns when tactics have changed.
|
|
|
|
|
|
|
+// inproxyHandleProxyTacticsPayload handles new tactics returned from the
|
|
|
|
|
+// proxy and returns when tactics have changed.
|
|
|
//
|
|
//
|
|
|
// inproxyHandleTacticsPayload duplicates some tactics-handling code from
|
|
// inproxyHandleTacticsPayload duplicates some tactics-handling code from
|
|
|
// doHandshakeRequest.
|
|
// doHandshakeRequest.
|
|
|
-func (controller *Controller) inproxyHandleTacticsPayload(
|
|
|
|
|
|
|
+func (controller *Controller) inproxyHandleProxyTacticsPayload(
|
|
|
networkID string, tacticsPayload []byte) bool {
|
|
networkID string, tacticsPayload []byte) bool {
|
|
|
|
|
|
|
|
if controller.config.DisableTactics {
|
|
if controller.config.DisableTactics {
|