Greetings all,I like to reuse the socket connection to send/receive tcp request/response once I done https request/response.Here is the scenario,The customized Chrome sends https requests, and receives response ( I can monitor this flow in net module within customized Chrome). Since http uses persistent connection, so after all expected responses done I assume the ssl connection is still alive. Now the question is how do I reuse *THIS* connection for my own tcp send/recv and return the recv (it's web page) to ask Chrome to display. The subsequent requests based on this page will all through the same connection.
In fact, there are three tasks here:1. my own tcp request to reuse the previously connected ssl socket.2. How to get my own tcp responses (web page) to render into Chrome.
3. the subsequent Chrome http requests based on 2's webpage should use the same 1's ssl connection.
It's like I need to ask customized Chrome to use the specified socket.I would like someone give suggestions/hints and possibilities. Where should I start to exploring. I guess net/socket is some entry point. I'd like to have more details.
cheers,all smooth
--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
Here is the scenario,The customized Chrome sends https requests, and receives response ( I can monitor this flow in net module within customized Chrome). Since http uses persistent connection, so after all expected responses done I assume the ssl connection is still alive. Now the question is how do I reuse *THIS* connection for my own tcp send/recv and return the recv (it's web page) to ask Chrome to display. The subsequent requests based on this page will all through the same connection.So you want to use the socket for stuff beyond HTTP? You intend to also have a custom server to make this work, I assume? Have you thought about just using all the stuff that's already in the Web stack to accomplish your goal?
In fact, there are three tasks here:1. my own tcp request to reuse the previously connected ssl socket.2. How to get my own tcp responses (web page) to render into Chrome.This is what HTTPS already does for you. What do you need that it doesn't have?
3. the subsequent Chrome http requests based on 2's webpage should use the same 1's ssl connection.I'm not sure what you mean here exactly, but it sounds a bit like a proxy (http://en.wikipedia.org/wiki/Proxy_server). If you can get what you need with existing technology (e.g., a proxy), you'll save yourself a lot of work and pain.
Thanks much for response.Here is the scenario,The customized Chrome sends https requests, and receives response ( I can monitor this flow in net module within customized Chrome). Since http uses persistent connection, so after all expected responses done I assume the ssl connection is still alive. Now the question is how do I reuse *THIS* connection for my own tcp send/recv and return the recv (it's web page) to ask Chrome to display. The subsequent requests based on this page will all through the same connection.So you want to use the socket for stuff beyond HTTP? You intend to also have a custom server to make this work, I assume? Have you thought about just using all the stuff that's already in the Web stack to accomplish your goal?yes, this is target for specific server.In fact, there are three tasks here:1. my own tcp request to reuse the previously connected ssl socket.2. How to get my own tcp responses (web page) to render into Chrome.This is what HTTPS already does for you. What do you need that it doesn't have?Different. After Chrome use the underlying socket for https request, I want to use this socket(server know it's special) again for my own tcp request. The requirement cannot get everything done in web stack.
3. the subsequent Chrome http requests based on 2's webpage should use the same 1's ssl connection.I'm not sure what you mean here exactly, but it sounds a bit like a proxy (http://en.wikipedia.org/wiki/Proxy_server). If you can get what you need with existing technology (e.g., a proxy), you'll save yourself a lot of work and pain.It's similar to proxy server. but we want to build this feature inside Chrome.
Greetings all,I like to reuse the socket connection to send/receive tcp request/response once I done https request/response.Here is the scenario,The customized Chrome sends https requests, and receives response ( I can monitor this flow in net module within customized Chrome). Since http uses persistent connection, so after all expected responses done I assume the ssl connection is still alive. Now the question is how do I reuse *THIS* connection for my own tcp send/recv and return the recv (it's web page) to ask Chrome to display. The subsequent requests based on this page will all through the same connection.In fact, there are three tasks here:1. my own tcp request to reuse the previously connected ssl socket.2. How to get my own tcp responses (web page) to render into Chrome.3. the subsequent Chrome http requests based on 2's webpage should use the same 1's ssl connection.It's like I need to ask customized Chrome to use the specified socket.
I would like someone give suggestions/hints and possibilities. Where should I start to exploring. I guess net/socket is some entry point. I'd like to have more details.
cheers,all smooth
On Wed, Jun 5, 2013 at 3:19 PM, all smooth <guang...@gmail.com> wrote:
Thanks much for response.Here is the scenario,The customized Chrome sends https requests, and receives response ( I can monitor this flow in net module within customized Chrome). Since http uses persistent connection, so after all expected responses done I assume the ssl connection is still alive. Now the question is how do I reuse *THIS* connection for my own tcp send/recv and return the recv (it's web page) to ask Chrome to display. The subsequent requests based on this page will all through the same connection.So you want to use the socket for stuff beyond HTTP? You intend to also have a custom server to make this work, I assume? Have you thought about just using all the stuff that's already in the Web stack to accomplish your goal?yes, this is target for specific server.In fact, there are three tasks here:1. my own tcp request to reuse the previously connected ssl socket.2. How to get my own tcp responses (web page) to render into Chrome.This is what HTTPS already does for you. What do you need that it doesn't have?Different. After Chrome use the underlying socket for https request, I want to use this socket(server know it's special) again for my own tcp request. The requirement cannot get everything done in web stack.But why does it have to be TCP? Let the browser manage that, and use some of the features available to you at the web platform level. If you own the page, use XMLHTTPRequest or WebSockets to communicate with the server. If you are using arbitrary content, then maybe you can use an extension instead of modifying Chromium.
3. the subsequent Chrome http requests based on 2's webpage should use the same 1's ssl connection.I'm not sure what you mean here exactly, but it sounds a bit like a proxy (http://en.wikipedia.org/wiki/Proxy_server). If you can get what you need with existing technology (e.g., a proxy), you'll save yourself a lot of work and pain.It's similar to proxy server. but we want to build this feature inside Chrome.If you're customizing Chromium anyway, maybe you can ship a proxy bundled with your custom Chromium fork, and make your custom Chromium fork always talk to that proxy?
The more you tinker too much with Chromium's internals, the more difficulty you are going to have keeping up with Chromium changes (even if you get it to work initially). And the more you try to subvert standard technologies like HTTPS, the more trouble you are going to have getting your stuff to actually work properly over real web proxies and routers.
Just my opinion. But I think you should think carefully about your requirements and try to find another approach that works with the existing architecture of Chromium and existing standards rather than against them.
This is going to be virtually impossible without rewriting vast portions of the Chrome network stack, I suspect. The sockets are hidden from requests inside of the various SocketPools which Chrome access via the HttpStreamFactory. To do what you propose requires penetrating numerous different layers of abstraction and I think is totally impractical.
I think Ryan H's answer pretty much contains the information at hand:
It's an intentional design goal of Chromium's network stack NOT to
expose the underlying socket through these layers. Any patches to do
so would, with a 99.9% certainty, be something that would be "dead on
arrival" because of this.
Because of this, I'm not really sure it's applicable for the
chromium-dev community, or something that would be valuable to
furthering Chromium's four S's of Security, Stability, Speed, and
Simplicity.
If you follow the code, you'll find your answer - the relationship
between the StreamSocket interface, the ClientSocketHandle, and the
ClientSocketPool. As Ryan said, you're looking at forking Chromium to
accomplish those goals - and at that point, any assistance we can
realistically provide is gone, because now you're asking questions
about your fork, and not Chromium.
No. The point of the connection pool is to pool connections. This
includes between tabs.
Ryan
I think these approaches are completely impractical. The scope of work required to implement them is very large and would require penetrating all kinds of layers of abstraction which would leave you with hideous spaghetti code. I can't discourage you strongly enough from this course of action. This path is doomed to failure, I fear.
I guess what I'm trying to say is that we're more than happy to answer
questions of "Did you consider X" or "Is X possible", but if the
answer is "Yes, and we decided not to" or "No, it's not possible",
then follow-up questions like "Well, how would I do it if I wanted to"
are things you're going to have to answer on your own.
Ryan
Attempts to
upstream such changes would, as I said, almost certainly be rejected
because of this.
I'm not trying to shut down any questions - as I said, we're happy to
try to answer questions where we can. After all, there is always room
for improvement.
Unfortunately, questions such as "How do I do X", when "doing X" is
clearly something we don't intend to support, are likely to simply go
unanswered. This is part of what it means to "not support" doing "X" -
at that point, you're going to have to figure how how to "do X" on
your own, with the code as your reference.
To be perfectly clear, getting the underlying socket is not something
we intend to support.
Again, this is software - anything is possible - but you're going to
have to work out how to do that on your own, because your solution
will ultimately be tailored to the problem you're trying to solve,
which is not a problem we're trying to solve.