我的请求流程如下;
HAProxy --> Varnish (4.0.1) --> Apache web backends
Run Code Online (Sandbox Code Playgroud)
当新请求进入HAProxy时,客户端的IP地址将被添加到X-Forwarded-For标头中(这很好!).但是,看起来Varnish HAProxy也在添加IP.当请求到达我的vcl_recv例程时,X-Forwarded-For标题是:
X-Forwarded-For: end-user-ip, haproxy-ip
Run Code Online (Sandbox Code Playgroud)
你可以在varnishlog输出中看到:
* << Request >> 8
- Begin req 7 rxreq
- Timestamp Start: 1409262358.542659 0.000000 0.000000
- Timestamp Req: 1409262358.542659 0.000000 0.000000
- ReqStart 192.168.1.103 48193
- ReqMethod PURGE
- ReqURL /some/path
- ReqProtocol HTTP/1.1
- ReqHeader Authorization: Basic xxx
- ReqHeader User-Agent: curl/7.30.0
- ReqHeader Host: example.com
- ReqHeader Accept: */*
- ReqHeader X-Forwarded-For: 1.2.3.4 …Run Code Online (Sandbox Code Playgroud) 是否可以以自动方式访问Google Cloud Source Repository,即使用服务帐户从GCE实例访问?
我在文档中看到的唯一身份验证方法是使用该gcloud auth login命令,该命令将验证我的个人用户访问repo,而不是我运行命令的机器.
service-accounts google-cloud-platform google-cloud-source-repos gcloud-cli
我已经实现了动画暂停,如下所述: How to patrick andresume CSS3animation using JavaScript?
这是我的旋转元素的 CSS:
.is-rotating{
-webkit-animation: circle 55s linear infinite;
-moz-animation: circle 55s linear infinite;
-ms-animation: circle 55s linear infinite;
animation: circle 55s linear infinite;
}
Run Code Online (Sandbox Code Playgroud)
我将一个is-paused类切换到有问题的元素onmouseover:
.is-paused{
-webkit-animation-play-state:paused;
-moz-animation-play-state:paused;
-o-animation-play-state:paused;
animation-play-state:paused;
}
Run Code Online (Sandbox Code Playgroud)
当我用 JS (onmouseout) 删除此类时,旋转动画重置为“原点”。有时会,有时不会。这种情况发生在 webkit(OSX 上的 Chrome 和 Safari)中,在 FF 中工作正常。
我知道animation-play-state这是一个实验性功能,但MDN 说它在 webkit 中应该可以正常工作。有谁对如何实现 webkit 浏览器有任何想法吗?
更新:这是 CSS 的其余部分:
@-webkit-keyframes circle {
from { -webkit-transform:rotate(0deg); }
to { -webkit-transform:rotate(360deg); }
} …Run Code Online (Sandbox Code Playgroud) 我想支持MaximumInputLength我的自定义Select2 数据适配器的装饰器.在我的自定义数据适配器中,Utils.Decorate()调用不执行任何操作.
看看这个要点,我可以在我初始化的同一个地方调用Decorator函数select2(),但这看起来很蹩脚而不是DRY,因为我想初始化许多这些Select元素.
为了为MyDataAdapter的所有实例启用最小输入,是否可以从适配器本身装饰该适配器?有一个更好的方法吗?
我的select2()电话:
$('select').select2({
dataAdapter: MyDataAdapter,
minimumInputLength: 2
});
Run Code Online (Sandbox Code Playgroud)
MyDataAdapter (没有依赖):
define([...], function(Utils, MinimumInputLength, ArrayAdapter){
function MyDataAdapter($element, options) {
this.$element = $element;
this.options = options;
MyDataAdapter.__super__.constructor.call(this, $element, options);
}
Utils.Extend(MyDataAdapter, ArrayAdapter);
Utils.Decorate(MyDataAdapter, MinimumInputLength); <-- does nothing
MyDataAdapter.prototype.query = function(params, callback) {
console.log('query!');
};
return MyDataAdapter;
});
Run Code Online (Sandbox Code Playgroud)