modify ovpn source?
Posted: Wed Jul 04, 2012 8:52 am
Hi, i need to modifie openvpn source to add a small feature in http poroxy option but i'm having trouble understanding the whole code. I only need to add additional header on http proxy option without if proxy is enable just like proxy option AGENT and VERSION only that it's already set additional header like HOST or X-Online-Host when proxy is enabled. I'm not that good in programming but i can modify the code only if i understand in. I know that proxy.c is responsible for the proxy code and also checked options.c which takes all commands to be process including proxy options. BTW i use 2.1.4 source.
under options.c i find this code in line4413.
I see that if it finds VERSION or AGENT after http-proxy-option it takes the the string p[2]. but where does ho->http_version = p[2] and ho->user_agent = p[2] take it?
I just need to add other Options like X-Online-Host and Host inside the program it self. What part of the source should i modify and sample of line of code to add?
And also i want to disable remote from the option to include remote server inside the program it self. I just have to include a variable with my remote port and ip but where do i edit remote server? thanks.
under options.c i find this code in line4413.
Code: Select all
else if (streq (p[0], "http-proxy-option") && p[1])
{
struct http_proxy_options *ho;
VERIFY_PERMISSION (OPT_P_GENERAL|OPT_P_CONNECTION);
ho = init_http_options_if_undefined (options);
if (streq (p[1], "VERSION") && p[2])
{
ho->http_version = p[2];
}
else if (streq (p[1], "AGENT") && p[2])
{
ho->user_agent = p[2];
}
I just need to add other Options like X-Online-Host and Host inside the program it self. What part of the source should i modify and sample of line of code to add?
And also i want to disable remote from the option to include remote server inside the program it self. I just have to include a variable with my remote port and ip but where do i edit remote server? thanks.