Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm looking for a small, fast, and reliable https proxy that I can extend to do the following:

  1. Look for https handshake requests.
  2. Run a regular expression against the host name being requested.
  3. If the expression matches the host name then don't send the request on but respond with a 302 redirect to a different site.

So, I guess I have the following questions about this:

  1. Is this possible? (I'm pretty sure the handshake request is not encrypted, I know I can do some pattern matching, the real question is...would I be able to send a fake 302 redirect to the client without it complaining about not having completed the handshake?)

  2. If it is possible, is there a linux app out there that does some or all of this? (I found this: http://www.kubat.nl/pages/microproxy) I was considering trying to build the remaining features into it but didn't want to try that if something else already does it.

  3. Do you have suggestions for other C++ Linux proxies I might be able to build this into?

Thanks in advance for your feedback.

EV

share|improve this question
    
BTW, welcome to Unix SE. How about editing your profile and changing your Display Name to something better than user548971? –  cjm Mar 27 '12 at 7:14
    
Are you looking for a standalone program, or does it have to be a C++ library? If you want a library, you should ask on Stack Overflow, a Stack Exchange site for programmers; Unix & Linux is for users and administrators. Don't repost; if you specifically need a C++ library, a moderator can migrate this question to Stack Overflow. –  Gilles Mar 27 '12 at 21:27
    
It can really be either. I just need to it to run on linux and be extensible. Microproxy might actually be the ticket. Squid is much to big for my application. I had thought about posting at Stack Overflow. What I need is rather specialized. I would say to leave the question here for now. If I have a more pointed programming question I will post it there. Thanks! –  exvance Mar 28 '12 at 1:56
add comment

2 Answers 2

3: Do you have suggestions for other C++ Linux proxies I might be able to build this into?

squid is a fast open source proxy that you can extend to your heart's content

share|improve this answer
add comment

This isn't possible either, unless by "URL" you mean "hostname". The Server Name Indication extension allows the client to indicate the hostname it's trying to connect to. Many browsers now support SNI. But the full URL isn't transmitted until after the handshake is complete.

So you can tell the difference between https://www.example.com/ and https://other.example.com/, but not between https://www.example.com/one and https://www.example.com/another.

Maybe if you explained exactly why you think you need to do this, somebody could come up with a solution.

share|improve this answer
    
Thanks for the quick response! That's good to know. For some reason I thought the handshake request included the url not just the domain/host name. The question is really the same. I'm good with just seeing the domain. –  exvance Mar 27 '12 at 7:26
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.