Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fyi, Meeh is working on "i2ptunnel" #32

Closed
meeh420 opened this issue Feb 3, 2014 · 10 comments
Closed

Fyi, Meeh is working on "i2ptunnel" #32

meeh420 opened this issue Feb 3, 2014 · 10 comments

Comments

@meeh420
Copy link
Contributor

meeh420 commented Feb 3, 2014

Just wanted to give you a heads up that I've started on the "client" part. In other words classes to link i2p::stream::Stream to a configured tcp port. I will commit when I got something, but it might take a while since I need to learn the ASIO library better. Still learning C++ in depth.

My initial design thoughts is close to this, if you change the server with the Stream object. http://www.partow.net/programming/tcpproxy/index.html

@orignal
Copy link
Contributor

orignal commented Feb 3, 2014

I would start from simple HTTP-proxy.
You can see the example how Stream class is used in HTTPServer.cpp. However I would like to implement async operations for Stream, that will let you attach to io_service easily.

@meeh420
Copy link
Contributor Author

meeh420 commented Feb 3, 2014

Yea, I've used the example from HTTPServer.cpp on how to query. I don't have any knowledge with io_service so that's something I try to read me up on now. Read some of the code in the link above too, gave me some ideas.

Async would be sweet because then I can do something like this:

m_I2PStream.async_read_some(
                    boost::asio::buffer(m_UpstreamData,max_data_length),
                    boost::bind(&I2PConnection::handleUpstreamRead,
                      shared_from_this(),
                      boost::asio::placeholders::error,
                      boost::asio::placeholders::bytes_transferred));

@orignal
Copy link
Contributor

orignal commented Feb 3, 2014

The bottom line of this design is you would have to allocate separate local port per I2P destination. Remember there are not so many local ports available, 2 bytes only.

@meeh420
Copy link
Contributor Author

meeh420 commented Feb 4, 2014

Ah, I see what you mean. Back to design board, need to do it in another way. Thanks.

This desgin would only be useful for IRC,smtp,pop with a static destination, and not HTTP.
Anyhow, I should make it possible to use multiple destinations, like the default IRC proxy.

@orignal
Copy link
Contributor

orignal commented Feb 4, 2014

That's why I'm saying HTTP proxy is simplest because it contains destination address in the headers.

@meeh420
Copy link
Contributor Author

meeh420 commented Feb 4, 2014

Ok, I'm going for that one first, then extend or implement for more later.

@meeh420
Copy link
Contributor Author

meeh420 commented Feb 17, 2014

Starting to get results. Just wondering, is it an good idea to "cache" leasesets or streams in the HTTP proxy? Thinking of senarioes where you load different files from the same host, seems waste of resource to lookup leaseset and create stream for each request.

What do you think?

@orignal
Copy link
Contributor

orignal commented Feb 17, 2014

As you might see I have implemented LeaseSet subscription mechanism meaning someone who is interested in it subscribes and LeaseSet gets updated automatically.

Why do you think looking up of LeaseSet or creating stream is something resource consuming?
If you mean ElGamal/Tags, that's assigned per destination not per stream.
However using same stream for downloading entire site, like images, frames, etc. would be good idea, but I'm not sure how it's sorted out at another end, as far as I see, it closes socket immediately once transmission end. That means if you receive "close" event you can't reuse same stream but have to establish new one.

@meeh420
Copy link
Contributor Author

meeh420 commented Apr 3, 2014

Hi, I sent you an mail to the mail address in your git checkin signature. Was hoping to have a little chat :) - Also, just close this issue when you read this.

@orignal
Copy link
Contributor

orignal commented Apr 3, 2014

Yes, I see you e-mail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants