在Google App Engine中按IP地址划分流量 [英] Traffic Splitting By IP Address on Google App Engine

查看:52
本文介绍了在Google App Engine中按IP地址划分流量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想根据一组已知的IP地址将流量定向到不同版本的Google App Engine代码.

I'd like to direct traffic to different versions of Google App Engine code based on a set list of known IP Addresses.

例如,如果传入请求来自给定列表上的IP地址,则将流量定向到版本1.否则,将流量定向到版本2.

For example, if an incoming request is from an IP Address on a given list, then traffic is directed to version 1. If not, then version 2.

是否可以通过管理控制台或部署配置执行此操作?

Is there a way to do this from the admin console or deployment configuration?

最终目标是从批准的IP地址访问站点时授予对其他功能的访问权限.如果无法从管理控制台执行此操作,则计划在用户登录过程中获取IP地址,并根据IP设置其安全角色.

The end goal is to grant access to extra features when the site is accessed from an approved IP Address. If I can't do this from the admin console, then I plan to get the IP Address during the user's login process, and set their security role based on IP.

推荐答案

管理控制台或部署过程中没有办法.但是,如果您进行基于cookie的流量拆分,则可以自己设置cookie(基于传入的IP地址或所需的其他值).该值存储在 GOOGAPPUID 中,而您要使用的值在文档,并且会根据您要分割的版本数以及您希望发送给每个版本的相应流量级别而有所不同.

There's not a way within the admin console or deployment process. However, if you do cookie-based traffic splitting, you can set the cookie yourself (based on the incoming IP address, or another value you desire). The value is stored in GOOGAPPUID and the value you'd want to use is described in the documentation, and varies depending on the number of versions you're splitting between and the respective levels of traffic you'd like to send to each version.

如果您不想为给定IP列表上的用户 not 进行流量拆分,则应确保为所有用户明确设置cookie.否则,默认情况下,App Engine将提供该值(并将一些用户发送到这两个版本).

If you don't want to do traffic splitting for users not on a given list of IPs, you should make sure to explicitly set the cookie for all users. Otherwise, App Engine will provide the value (and send some users to both versions) by default.

这篇关于在Google App Engine中按IP地址划分流量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆