{"id":78,"date":"2009-12-04T05:26:00","date_gmt":"2009-12-04T10:26:00","guid":{"rendered":"http:\/\/www.rajatswarup.com\/blog\/?p=78"},"modified":"2012-06-20T14:09:33","modified_gmt":"2012-06-20T19:09:33","slug":"ratproxy-on-cygwin","status":"publish","type":"post","link":"https:\/\/www.rajatswarup.com\/blog\/2009\/12\/04\/ratproxy-on-cygwin\/","title":{"rendered":"Ratproxy on Cygwin"},"content":{"rendered":"<p>I have used Michal Zalewski&#8217;s Ratproxy on Google code.  I like it a lot.  But I also like to have it on Windows.  But it seems that the makefile that comes with ratproxy is not really compatible with cygwin.<br \/>If you have the gcc, make, openssl, openssl-dev packages installed on cygwin, all you need to do is remove the -Wno-pointer flag from the CFLAGS entry from the Makefile.<br \/>So my Makefile&#8217;s CFLAGS line looks like:<\/p>\n<pre>CFLAGS  = -Wall -O3 -D_GNU_SOURCE<\/pre>\n<p>I also replaced $(CC) with gcc just because I felt like it.  \ud83d\ude42<br \/>Compile it with <span style=\"font-family:courier new;\">make <\/span>command.<br \/>Do not forget to <span style=\"font-family:courier new;\">dos2unix<\/span> the ratproxy-report.sh otherwise you will get some errors with &#8216;\\r&#8217;  and some other random stuff when you run the report generator shell scripts.<br \/>Run ratproxy as :<br \/><span style=\"font-family:courier new;\">c:\\tools\\ratproxy>ratproxy.exe -p 8000 -v c:\\testdir -w ratlog -d example.com  -extifscfjmXCk<\/span><br \/>Once you have the log to generate a nice looking pretty report:<br \/><span style=\"font-family: courier new;\">bash$ .\/ratproxy-report.sh ratlog &gt;reportname.html<\/span><\/p>\n<p>Update 06\/20\/2012:<br \/>\nIf you get the error shown below:<br \/>\n<code>ratproxy.c: In function `listen_loop':<br \/>\nratproxy.c:1635:5: error: incompatible type for argument 2 of `waitpid'<br \/>\n\/usr\/include\/sys\/wait.h:43:7: note: expected `__wait_status_ptr_t' but argument<br \/>\nis of type `unsigned int *'<br \/>\nMakefile:30: recipe for target `ratproxy' failed<br \/>\nmake: *** [ratproxy] Error 1<\/code><\/p>\n<p>Do the following:<br \/>\n1. Go to line # 1635 and change the line to  <code>while (waitpid(-1,(int*)&x,WNOHANG) > 0);<\/code><br \/>\n2. Goto the command line and type <\/p>\n<pre>make<\/pre>\n<p>You should be able to compile ratproxy.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have used Michal Zalewski&#8217;s Ratproxy on Google code. I like it a lot. But I also like to have it on Windows. But it seems that the makefile that comes with ratproxy is not really compatible with cygwin.If you have the gcc, make, openssl, openssl-dev packages installed on cygwin, all you need to do [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[197,193],"tags":[205,204,206],"class_list":["post-78","post","type-post","status-publish","format-standard","hentry","category-tools","category-webappsec","tag-cygwin","tag-ratproxy","tag-scanner"],"_links":{"self":[{"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/posts\/78","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/comments?post=78"}],"version-history":[{"count":3,"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/posts\/78\/revisions"}],"predecessor-version":[{"id":349,"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/posts\/78\/revisions\/349"}],"wp:attachment":[{"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/media?parent=78"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/categories?post=78"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/tags?post=78"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}