cppcms-users Mailing List for CppCMS C++ Web Framework (Page 86)
Brought to you by:
artyom-beilis
You can subscribe to this list here.
2009 |
Jan
|
Feb
(22) |
Mar
|
Apr
(3) |
May
|
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
(15) |
Nov
(16) |
Dec
(13) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2010 |
Jan
(4) |
Feb
|
Mar
(8) |
Apr
(8) |
May
(8) |
Jun
(36) |
Jul
(63) |
Aug
(126) |
Sep
(47) |
Oct
(66) |
Nov
(46) |
Dec
(42) |
2011 |
Jan
(87) |
Feb
(24) |
Mar
(54) |
Apr
(21) |
May
(22) |
Jun
(18) |
Jul
(22) |
Aug
(101) |
Sep
(57) |
Oct
(33) |
Nov
(34) |
Dec
(66) |
2012 |
Jan
(64) |
Feb
(76) |
Mar
(73) |
Apr
(105) |
May
(93) |
Jun
(83) |
Jul
(84) |
Aug
(88) |
Sep
(57) |
Oct
(59) |
Nov
(35) |
Dec
(49) |
2013 |
Jan
(67) |
Feb
(17) |
Mar
(49) |
Apr
(64) |
May
(87) |
Jun
(64) |
Jul
(93) |
Aug
(23) |
Sep
(15) |
Oct
(16) |
Nov
(62) |
Dec
(73) |
2014 |
Jan
(5) |
Feb
(23) |
Mar
(21) |
Apr
(11) |
May
(1) |
Jun
(19) |
Jul
(27) |
Aug
(16) |
Sep
(5) |
Oct
(37) |
Nov
(12) |
Dec
(9) |
2015 |
Jan
(7) |
Feb
(7) |
Mar
(44) |
Apr
(28) |
May
(5) |
Jun
(12) |
Jul
(8) |
Aug
|
Sep
(39) |
Oct
(34) |
Nov
(30) |
Dec
(34) |
2016 |
Jan
(66) |
Feb
(23) |
Mar
(33) |
Apr
(15) |
May
(11) |
Jun
(15) |
Jul
(26) |
Aug
(4) |
Sep
(1) |
Oct
(30) |
Nov
(10) |
Dec
|
2017 |
Jan
(52) |
Feb
(9) |
Mar
(24) |
Apr
(16) |
May
(9) |
Jun
(12) |
Jul
(33) |
Aug
(8) |
Sep
|
Oct
(1) |
Nov
(2) |
Dec
(6) |
2018 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
(14) |
Jun
(1) |
Jul
(9) |
Aug
(1) |
Sep
(13) |
Oct
(8) |
Nov
(2) |
Dec
(2) |
2019 |
Jan
(1) |
Feb
(1) |
Mar
(3) |
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
2020 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(9) |
Jul
(6) |
Aug
(25) |
Sep
(10) |
Oct
(10) |
Nov
(6) |
Dec
|
2021 |
Jan
|
Feb
|
Mar
(7) |
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
(9) |
Oct
(1) |
Nov
|
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Christian G. <chr...@gm...> - 2012-05-21 11:45:57
|
Hi all, I am very new to cppcms but I am quite far in doing a conversion of a RoR app to cppcms. On thing thats missing is the user login. I have a login sub-app, which works nicely but I am looking for a way to check if users is login in on every page access - something like before_filter in RoR. Does there exists some linke that in cppcms? thanks -- Christian Gmeiner, MSc |
From: le ba <hma...@gm...> - 2012-05-21 10:29:16
|
Hi , I would like explain my questions. For example I create my dynamic page (like template or templates_inheritance in the example) with ajax using json_rpc inside: 1. Will I do a derivation from cppcms::appliaction and make a json call inside or 2. Will I do a derivation from cppcms::rpc::json_rpc_server for all application and children. I'd like to know if the context is shared by url dispather and json_rpc_call or they have two different context? Thank you Artyom. ---------- Forwarded message ---------- From: le ba <hma...@gm...> Date: 2012/5/21 Subject: cppcms::rpc::json_rpc_server usage. To: cpp...@li... Cc: art...@ya... Hi, Instead derived from cppcms::application, my application is derived from cppcms::rpc::json_rpc_server . I would like to populate the dynamic page with data from a request using ajax and json. My Questions are: - Is it a normal usage of cppcms framework because I don't find an example like this within the example that you have provided? - If yes, are there some conditions or some style of code for this kind of usage? Thank you very much. hmaminirina. |
From: le ba <hma...@gm...> - 2012-05-21 08:39:42
|
Hi, Instead derived from cppcms::application, my application is derived from cppcms::rpc::json_rpc_server . I would like to populate the dynamic page with data from a request using ajax and json. My Questions are: - Is it a normal usage of cppcms framework because I don't find an example like this within the example that you have provided? - If yes, are there some conditions or some style of code for this kind of usage? Thank you very much. hmaminirina. |
From: <ele...@ex...> - 2012-05-21 08:24:13
|
>> What the hell is going on here? > strange strange. I don't really know if this could help, but: ts is a > string and you give two times the same string into the > preparedstatement. You could try to copy ts to ts2 (string ts2=ts) and > try that again with << ts << ts2. And then if that helps, that would be > strange though ;) > > Find out what's going on there ! ^^ Yeah I tried cloning the string via a copy constructor: sql << os.str() << string(ts) << string(ts); but it made no difference. I believe string always deep copies. In the end, instead of passing it a string, I used strptime() to convert the string to a std::tm struct and it's working fine. Very weird. |
From: Marcel H. <ke...@co...> - 2012-05-21 07:29:52
|
Am 21.05.2012 06:52, schrieb ele...@ex...: > UPDATE: > > Something even stranger. If I replace all the hardcoded times and run it > through a prepared statement > > This works(always returns 2 rows) > > r = sql<< os.str() > << "2012-05-17 23:59:59" > << "2012-05-17 23:59:59" > << aircraft_id; > > but this doesnt(returns sometimes 1, sometimes 2 rows): > > string ts = "2012-05-17 23:59:59"; > > r = sql<< os.str() > << ts > << ts > << aircraft_id; > > What the hell is going on here? strange strange. I don't really know if this could help, but: ts is a string and you give two times the same string into the preparedstatement. You could try to copy ts to ts2 (string ts2=ts) and try that again with << ts << ts2. And then if that helps, that would be strange though ;) Find out what's going on there ! ^^ Regards |
From: <ele...@ex...> - 2012-05-21 04:52:44
|
UPDATE: Something even stranger. If I replace all the hardcoded times and run it through a prepared statement This works(always returns 2 rows) r = sql << os.str() << "2012-05-17 23:59:59" << "2012-05-17 23:59:59" << aircraft_id; but this doesnt(returns sometimes 1, sometimes 2 rows): string ts = "2012-05-17 23:59:59"; r = sql << os.str() << ts << ts << aircraft_id; What the hell is going on here? |
From: <ele...@ex...> - 2012-05-21 03:52:11
|
I'm truly stumped by this SQL query. This works as expected: SELECT * FROM af_scheduled_items i INNER JOIN af_scheduled_items_history h1 ON h1.root_id=i.id WHERE h1.date_fitted <= '2012-05-17 23:59:59' AND h1.id IN (SELECT max(h2.id) FROM af_scheduled_items_history h2 WHERE h2.date_fitted <= '2012-05-17 23:59:59' AND h2.root_id=i.id) AND h1.aircraft_id = ? ORDER BY i.id ASC Returns 2 rows which is what's expected. If I replace the h2.date_fitted with ? SELECT * FROM af_scheduled_items i INNER JOIN af_scheduled_items_history h1 ON h1.root_id=i.id WHERE h1.date_fitted <= '2012-05-17 23:59:59' AND h1.id IN (SELECT max(h2.id) FROM af_scheduled_items_history h2 WHERE h2.date_fitted <= ? AND h2.root_id=i.id) AND h1.aircraft_id = ? ORDER BY i.id ASC This returns 1 row. And if I replace both date_fitted dates with ? SELECT * FROM af_scheduled_items i INNER JOIN af_scheduled_items_history h1 ON h1.root_id=i.id WHERE h1.date_fitted <= ? AND h1.id IN (SELECT max(h2.id) FROM af_scheduled_items_history h2 WHERE h2.date_fitted <= ? AND h2.root_id=i.id) AND h1.aircraft_id = ? ORDER BY i.id ASC This returns sometimes 1 row, sometimes 2 rows. Can someone with enough wisdom explain this? |
From: <ele...@ex...> - 2012-05-18 09:40:17
|
> it is not ptime, booster::ptime::universal_time converts ptime to std::tm > and vise versa. The overload > is for std::tm > I see, but the question stays - whats the best way to convert date_time to std::tm? I'd rather not mix both ptime and date_time in the project. |
From: Leon <le...@wl...> - 2012-05-18 09:07:29
|
Hi, Is there any document on handling HTTP PUT? Thanks! |
From: Artyom B. <art...@ya...> - 2012-05-18 05:04:24
|
it is not ptime, booster::ptime::universal_time converts ptime to std::tm and vise versa. The overload is for std::tm Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: "ele...@ex..." <ele...@ex...> >To: Artyom Beilis <art...@ya...>; cpp...@li... >Sent: Friday, May 18, 2012 1:45 AM >Subject: Re: [Cppcms-users] sqlite3 CURRENT_TIMESTAMP compare to date_time > >Thanks Artyom, > > >> sql << "select ... ?" << >> booster::ptime::universal_time(booster::ptime::now()) << ... > >I didnt notice there was an overloaded operator<< for ptime. Can we add >something similar for date_time? > >Petr > > >------------------------------------------------------------------------------ >Live Security Virtual Conference >Exclusive live event will cover all the ways today's security and >threat landscape has changed and how IT managers can respond. Discussions >will include endpoint security, mobile security and the latest in malware >threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |
From: <ele...@ex...> - 2012-05-17 22:45:29
|
Thanks Artyom, > sql << "select ... ?" << > booster::ptime::universal_time(booster::ptime::now()) << ... I didnt notice there was an overloaded operator<< for ptime. Can we add something similar for date_time? Petr |
From: Artyom B. <art...@ya...> - 2012-05-17 19:03:01
|
Web sockets support isn't high priority dues to several factors: 1. Lack of standardization especially from the Web-Server <-> application communication.2 2. Lack of decent Browser support (different versions support different incompatible versions. So I don't know when I get to work on it. There are much more tasks with higher priority, I don't know even when 1.2 would be ready Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: Zheng Ping <ky...@gm...> >To: cpp...@li... >Sent: Thursday, May 17, 2012 7:11 PM >Subject: [Cppcms-users] When will the CppCMS 1.3 be released? > > >Hello, all: > I have learned CppCMS for about a month. I like the comet cppcms provided. And I am waiting the websocket of cppcms 1.3. I want to know when will the CppCMS 1.3 be relased? > > > -- >with kind regards > >------------------------------------------------------------------------------ >Live Security Virtual Conference >Exclusive live event will cover all the ways today's security and >threat landscape has changed and how IT managers can respond. Discussions >will include endpoint security, mobile security and the latest in malware >threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |
From: Zheng P. <ky...@gm...> - 2012-05-17 16:11:32
|
Hello, all: I have learned CppCMS for about a month. I like the comet cppcms provided. And I am waiting the websocket of cppcms 1.3. I want to know when will the CppCMS 1.3 be relased? -- with kind regards |
From: Artyom B. <art...@ya...> - 2012-05-17 11:05:19
|
> Hi, > > Just a quick question. > > Given a column in an sqlite database is set to DEFAULT CURRENT_TIMESTAMP, > which is stored in UTC, and not local time and an SQL SELECT such as > > SELECT * FROM table WHERE created_at < ? > > and a locale::date_time object representing current time, should date_time > be first converted to UTC before being sent to the SQL query? > Yes... if you use cppdb you can do it by sql << "select ... ?" << booster::ptime::universal_time(booster::ptime::now()) << ... > ie. > > ostringstream os; > > os << as::ftime("%Y-%m-%d %H:%M:S") << > as::timezone("UTC") << now; > > 1) Is this correct? > Yes it is, however it is better to use as::gmt rather that as::timezone("UTC"); > 2) What if the column is not a timestamp but a date, and the query is > comparing date with date_time. Should conversion to UTC be still done? This is good question. The problem is in what time zone you refer to date. Usually date is meaningless out of timezone scope. What does 2011-03-04 mean? If it is in GMT time in certain time zones it would be from 7 AM to 7 AM So you likely do not want to store dates in UTC, if you store dates in UTC you likely need to store entire timestamp. > > Thanks, > Petr Artyom |
From: <ele...@ex...> - 2012-05-17 10:40:06
|
Hi, Just a quick question. Given a column in an sqlite database is set to DEFAULT CURRENT_TIMESTAMP, which is stored in UTC, and not local time and an SQL SELECT such as SELECT * FROM table WHERE created_at < ? and a locale::date_time object representing current time, should date_time be first converted to UTC before being sent to the SQL query? ie. ostringstream os; os << as::ftime("%Y-%m-%d %H:%M:S") << as::timezone("UTC") << now; 1) Is this correct? 2) What if the column is not a timestamp but a date, and the query is comparing date with date_time. Should conversion to UTC be still done? Thanks, Petr |
From: Artyom B. <art...@ya...> - 2012-05-12 11:59:22
|
>a field such as select gets populated by AJAX. > >Ive got 2 selects. One gets populated the usual way via select.add(name, >value) and depending on what user chooses, the 2nd select gets populated >through AJAX. > >The problem is the only way to get the value is via request().post(name). > >In effect this bypasses form.validate() > See, if the 2nd select is populated by the ajax that means that you don't know what are the valid choices, that means that validate() can't actually validate the required form. In that case just use request().post(name) because in any case you need your own validation logic. Artyom |
From: <ele...@ex...> - 2012-05-12 02:25:05
|
a field such as select gets populated by AJAX. Ive got 2 selects. One gets populated the usual way via select.add(name, value) and depending on what user chooses, the 2nd select gets populated through AJAX. The problem is the only way to get the value is via request().post(name). In effect this bypasses form.validate() You can't even set the 2nd select field manually - form.myselect.selected_id(request.post("myselect")) this causes an exception because myselect hasn't been populated with the right values from the beginning. Petr |
From: doug l. <bi...@gm...> - 2012-05-10 18:49:20
|
That did the trick, thankyou very much! On 10 May 2012 19:05, kpeo <sla...@ya...> wrote: > Hello, > > As explained in message before, use iterators over json object: > > cppcms::json::object > ob=settings().get<cppcms::json::object>("imageservice.types"); > > for(cppcms::json::object::const_iterator > p=ob.begin();p!=ob.end();++p) { > if(p->second.type() == cppcms::json::is_object){ > std::cout << "key [" << p->first << "]: " << > p->second << std::endl; > } > } > > Full code (for *nix) attached, compile: "g++ -lcppcms main.cpp -o test" > > Also, for some detail, see article: > > http://cppcms.com/wikipp/en/page/cppcms_1x_json > > 10.05.2012, 20:58, "doug livesey" <bi...@gm...>: > > Hi -- if I had this json object: > { > "service": { > "api": "http", > "port": 3001 > }, > "http": { > "script_names": [ "/imageservice" ] > }, > "imageservice": { > "secret": "sup3rs3cr3t", > "storage": "tmp", > "types": { > "test-type-1": { > "on_save": [ ".JPEG" ], > "versions": { > "big": [ "300x1000>" ], > "thumb": [ "75x75#" ], > "thumb-png": [ "75x75#", ".PNG" ] > } > }, > "test-type-2": { > "on_save": [ "600x150!" ], > "versions": { > "gallery-jpeg": [ "50%", ".JPEG" ], > "gallery-png": [ "50%", ".PNG" ] > } > } > } > } > } > Would it be possible for me to query the JSON value object to find out > that there are two "type" values in the "imageservice" bit, and that those > types had keys of "test-type-1" and "test-type-2"? > I've been trying & failing to achieve this. > Thanks for any & all help, > Doug. > > > ------------------------------------------------------------------------------ > > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > |
From: kpeo <sla...@ya...> - 2012-05-10 18:05:17
|
<div>Hello,</div><div> </div><div>As explained in message before, use iterators over json object:</div><div> </div><div> cppcms::json::object ob=settings().get<cppcms::json::object>("imageservice.types");<br /><br /> for(cppcms::json::object::const_iterator p=ob.begin();p!=ob.end();++p) {<br /> if(p->second.type() == cppcms::json::is_object){<br /> std::cout << "key [" << p->first << "]: " << p->second << std::endl;<br /> } <br /> } </div><div> </div><div>Full code (for *nix) attached, compile: "g++ -lcppcms main.cpp -o test"</div><div> </div><div>Also, for some detail, see article:</div><div> </div><div>http://cppcms.com/wikipp/en/page/cppcms_1x_json</div><div> </div><div>10.05.2012, 20:58, "doug livesey" <bi...@gm...>:</div><blockquote type="cite">Hi -- if I had this json object:<div><div>{</div><div> "service": {</div><div> "api": "http",</div><div> "port": 3001</div><div> },</div><div> "http": {</div><div> "script_names": [ "/imageservice" ]</div><div> },</div><div> "imageservice": {</div><div> "secret": "sup3rs3cr3t",</div><div> "storage": "tmp",</div><div> "types": {</div><div> "test-type-1": {</div><div> "on_save": [ ".JPEG" ],</div><div> "versions": {</div><div> "big": [ "300x1000>" ],</div><div> "thumb": [ "75x75#" ],</div><div> "thumb-png": [ "75x75#", ".PNG" ]</div><div> }</div><div> },</div><div> "test-type-2": {</div><div> "on_save": [ "600x150!" ],</div><div> "versions": {</div><div> "gallery-jpeg": [ "50%", ".JPEG" ],</div><div> "gallery-png": [ "50%", ".PNG" ]</div><div> }</div><div> }</div><div> }</div><div> }</div><div>}</div></div><div>Would it be possible for me to query the JSON value object to find out that there are two "type" values in the "imageservice" bit, and that those types had keys of "test-type-1" and "test-type-2"?</div><div>I've been trying & failing to achieve this.</div><div>Thanks for any & all help,</div><div> Doug.</div><p>------------------------------------------------------------------------------<br />Live Security Virtual Conference<br />Exclusive live event will cover all the ways today's security and <br />threat landscape has changed and how IT managers can respond. Discussions <br />will include endpoint security, mobile security and the latest in malware <br />threats. <a href="http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/">http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/</a></p><p>_______________________________________________<br />Cppcms-users mailing list<br /><a href="mailto:Cpp...@li...">Cpp...@li...</a><br /><a href="https://lists.sourceforge.net/lists/listinfo/cppcms-users">https://lists.sourceforge.net/lists/listinfo/cppcms-users</a></p></blockquote> |
From: Daniel V. <chi...@gm...> - 2012-05-10 17:49:39
|
using cppcms; try { json::value v; ... // test if object "types" exist json::object& o types = v.at("types").object(); // note that "o" is a std::map for ( json::object::iterator i = o.begin; i != o.end(); ++i) { // i->first contains key name // i->second contains mapped value ... } } catch(json::bad_value_cast const& e) { //error handling } Reference: http://cppcms.com/cppcms_ref/latest/classcppcms_1_1json_1_1value.html#aa42bb35c356312bdee5a37bc0350264c http://cppcms.com/cppcms_ref/latest/classcppcms_1_1json_1_1value.html#ac8bcaa686b3ec1ad0cc22d663bce4566 http://cppcms.com/cppcms_ref/latest/namespacecppcms_1_1json.html#a4849268540ccdea30cfa408d6706d0c9 > Would it be possible for me to query the JSON value object to find out > that there are two "type" values in the "imageservice" bit, and that > those types had keys of "test-type-1" and "test-type-2"? > I've been trying & failing to achieve this. > Thanks for any & all help, > Doug. |
From: doug l. <bi...@gm...> - 2012-05-10 16:59:00
|
Hi -- if I had this json object: { "service": { "api": "http", "port": 3001 }, "http": { "script_names": [ "/imageservice" ] }, "imageservice": { "secret": "sup3rs3cr3t", "storage": "tmp", "types": { "test-type-1": { "on_save": [ ".JPEG" ], "versions": { "big": [ "300x1000>" ], "thumb": [ "75x75#" ], "thumb-png": [ "75x75#", ".PNG" ] } }, "test-type-2": { "on_save": [ "600x150!" ], "versions": { "gallery-jpeg": [ "50%", ".JPEG" ], "gallery-png": [ "50%", ".PNG" ] } } } } } Would it be possible for me to query the JSON value object to find out that there are two "type" values in the "imageservice" bit, and that those types had keys of "test-type-1" and "test-type-2"? I've been trying & failing to achieve this. Thanks for any & all help, Doug. |
From: kpeo <sla...@ya...> - 2012-05-08 12:43:50
|
Oh, sorry, i'm hastened with my last letter. You answer cover questions. Thanks very much for so fast and detailed answer! > > There is request().remote_address() that helps you to deal with. > > > > If your run behind reverse proxy, such proxies usually define headers > > like X-Real-IP headers that are set to variables like HTTP_X_REAL_IP. > > > > HTTP Proxies usually handle this correctly preventing hijacking > > such headers. > > > > If you use internal HTTP web server take a look on > > > > http://cppcms.com/wikipp/en/page/cppcms_1x_config#http.proxy.remote_addr_headers > > > > That allow request().remote_address() behave as expected > > > > Artyom Beilis > > -------------- > > CppCMS - C++ Web Framework: http://cppcms.com/ > > CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ > > > > ----- Original Message ----- > > > >> > From: kpeo <sla...@ya...> > >> > To: cpp...@li... > >> > Cc: > >> > Sent: Tuesday, May 8, 2012 1:10 PM > >> > Subject: [Cppcms-users] getting real ip of client > >> > > >> > Hello, > >> > > >> > Is there any way to check in CppCMS application whether client connection is > >> > local or remote (or just get real ip of client connection)? > >> > Because any request environment like HTTP_CLIENT_IP can be faked and required > >> > low-level aio functions to get connection IP, that inaccessible in the > >> > application/service/request classes. > >> > > >> > Regards, > >> > kpeo > >> > > >> > ------------------------------------------------------------------------------ > >> > Live Security Virtual Conference > >> > Exclusive live event will cover all the ways today's security and > >> > threat landscape has changed and how IT managers can respond. Discussions > >> > will include endpoint security, mobile security and the latest in malware > >> > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > >> > _______________________________________________ > >> > Cppcms-users mailing list > >> > Cpp...@li... > >> > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > > ------------------------------------------------------------------------------ > > Live Security Virtual Conference > > Exclusive live event will cover all the ways today's security and > > threat landscape has changed and how IT managers can respond. Discussions > > will include endpoint security, mobile security and the latest in malware > > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > > _______________________________________________ > > Cppcms-users mailing list > > Cpp...@li... > > https://lists.sourceforge.net/lists/listinfo/cppcms-users -- |
From: kpeo <sla...@ya...> - 2012-05-08 12:32:43
|
Shure, question is complex and highly depends on environment. Assumed, that we use CppCMS without any web-servers, connected to TCP/IP sockets. So can (in contrast of Unix-sockets) "see" TCP/IP fields of client's packets. While, my method is simple: 1. check IP in HTTP_CLIENT_IP, HTTP_X_FORWARDED_FOR, request().remote_addr() 2. check resulting IP on local interfaces of system. Anyone encountered with a similar task? Thanks anyway! > > Hello, > > > > Is there any way to check in CppCMS application whether client connection is local or remote (or just get real ip of client connection)? > > Because any request environment like HTTP_CLIENT_IP can be faked and required low-level aio functions to get connection IP, that inaccessible in the application/service/request classes. > > > > Regards, > > kpeo > > > > ------------------------------------------------------------------------------ > > Live Security Virtual Conference > > Exclusive live event will cover all the ways today's security and > > threat landscape has changed and how IT managers can respond. Discussions > > will include endpoint security, mobile security and the latest in malware > > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > > _______________________________________________ > > Cppcms-users mailing list > > Cpp...@li... > > https://lists.sourceforge.net/lists/listinfo/cppcms-users -- |
From: Artyom B. <art...@ya...> - 2012-05-08 12:06:27
|
There is request().remote_address() that helps you to deal with. If your run behind reverse proxy, such proxies usually define headers like X-Real-IP headers that are set to variables like HTTP_X_REAL_IP. HTTP Proxies usually handle this correctly preventing hijacking such headers. If you use internal HTTP web server take a look on http://cppcms.com/wikipp/en/page/cppcms_1x_config#http.proxy.remote_addr_headers That allow request().remote_address() behave as expected Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ ----- Original Message ----- > From: kpeo <sla...@ya...> > To: cpp...@li... > Cc: > Sent: Tuesday, May 8, 2012 1:10 PM > Subject: [Cppcms-users] getting real ip of client > > Hello, > > Is there any way to check in CppCMS application whether client connection is > local or remote (or just get real ip of client connection)? > Because any request environment like HTTP_CLIENT_IP can be faked and required > low-level aio functions to get connection IP, that inaccessible in the > application/service/request classes. > > Regards, > kpeo > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
From: kpeo <sla...@ya...> - 2012-05-08 10:26:25
|
Hello, Is there any way to check in CppCMS application whether client connection is local or remote (or just get real ip of client connection)? Because any request environment like HTTP_CLIENT_IP can be faked and required low-level aio functions to get connection IP, that inaccessible in the application/service/request classes. Regards, kpeo |