testcookie-flash-processor is a simple web server generating SWF(Flash) for cookie installation.
Server can be used with testcookie-nginx-module for setting cookie via flash plugin.
This project is Proof-of-Contept for the people, who ask me to add "Flash functionality" to testcookie-nginx-module.
Grab and install libraries:
- My fork of libming, don't forget to compile and install Python extension
- Fapws
- Swfobject
- Grab testcookie-nginx-module
Build nginx with testcookie-nginx-module, use example configuration.
Run testcookie-flash-processor with run.py.
server {
listen 80;
server_name domain.com;
testcookie off;
testcookie_name BPC;
testcookie_secret keepmescret;
testcookie_session $remote_addr;
testcookie_arg attempt;
testcookie_max_attempts 3;
testcookie_fallback /cookies.html?backurl=http://$host$request_uri;
testcookie_get_only on;
testcookie_redirect_via_refresh on;
testcookie_refresh_template '<html><body><script type="text/javascript" src="/swfobject.js"></script><script type="text/javascript">swfobject.embedSWF("/testcookie.swf", "cookie_installer", "100", "100", "9.0.0", "/expressInstall.swf", {"nexturl":"$testcookie_nexturl"});</script><div id="cookie_installer"></div></body></html>';
location = /cookies.html {
root /var/www/public_html;
}
location = /swfobject.js {
testcookie off;
gzip on;
gzip_min_length 1000;
gzip_types text/plain;
root /usr/local/nginx/root;
}
location = /expressInstall.swf {
testcookie off;
gzip on;
gzip_min_length 1000;
gzip_types text/plain;
root /usr/local/nginx/root;
}
location = /testcookie.swf {
testcookie var;
proxy_pass http://127.0.0.1:1234/;
proxy_set_header Testcookie-Value $testcookie_set;
proxy_set_header Testcookie-Valid $testcookie_ok;
proxy_set_header Testcookie-Name "BPC";
}
location / {
testcookie on;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://127.0.0.1:8080;
}
}
Check the "doc" directory for the list of things you can do yourself.
Available on github at kyprizel/testcookie-flash-processor.
Feel free to report bugs and send patches to [email protected] or use github's issue tracker(http://github.com/kyprizel/testcookie-flash-processor/issues).
- Thanks to Vlad Roskov (aka vos) for helping me with Flash debugging.
Copyright (C) 2012 Eldar Zaitov ([email protected]).
All rights reserved.
This module is licenced under the terms of BSD license.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of the authors nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.