Hi,
cxxtools has a method getPeerAddr() in cxxtoos::net::TcpSocket but there
is currently no good way to get it in a http responder.
In the responder there is a virtual method beginRequest which gets a
std::istream. It is actually a cxxtools::IOStream, which has a attached
device. The attached device is the tcp connection. With some ugly
casting you can get the tcp connection.
It looks like it would be a useful feature, which I should implement.
Tommi
Am 22.03.2015 um 18:14 schrieb Gerald Dachs:
> Hi,
>
> I use cxxtools for a small restful api application. It works just fine,
> thanks for this nice piece of software!
>
> Now I would like to restrict the allowed remote IPs, but I can't see how
> I get the remote address from the request. Of course I could do
> getHeader("REMOTE_ADDR"), but that could easy get faked.
>
> Does somebody have a small code snippet for getting the remote address
> somehow in a reliable way?
>
> Regards
> Gerald
>
>
> !DSPAM:550ef887184681070818870!
>
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming The Go Parallel Website, sponsored
> by Intel and developed in partnership with Slashdot Media, is your hub for all
> things parallel software development, from weekly thought leadership blogs to
> news, videos, case studies, tutorials and more. Take a look and join the
> conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> Tntnet-general mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/tntnet-general
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general