OK....forget the code...how about some pointers?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jim

    OK....forget the code...how about some pointers?

    I am trying to write an HTTP/HTTPS proxy server in VB.Net 2005.

    But, I don't really even know how the internal workings of a proxy should
    act. Does anyone have anything on the protocols used in handling requests by
    proxies?

    I have Googled my eyes out....and found nothing.

    (BTW, props to Google for refusing the ridiculous request for their search
    results.)

    Jim


  • Jochen Kalmbach [MVP]

    #2
    Re: OK....forget the code...how about some pointers?

    Hi Jim![color=blue]
    > I am trying to write an HTTP/HTTPS proxy server in VB.Net 2005.
    >
    > But, I don't really even know how the internal workings of a proxy should
    > act. Does anyone have anything on the protocols used in handling requests by
    > proxies?[/color]







    --
    Greetings
    Jochen

    My blog about Win32 and .NET

    Comment

    • Jim

      #3
      Re: OK....forget the code...how about some pointers?


      "Jochen Kalmbach [MVP]" <nospam-Jochen.Kalmbach @holzma.de> wrote in message
      news:unBBcEzHGH A.984@tk2msftng p13.phx.gbl...[color=blue]
      > Hi Jim![color=green]
      >> I am trying to write an HTTP/HTTPS proxy server in VB.Net 2005.
      >>
      >> But, I don't really even know how the internal workings of a proxy should
      >> act. Does anyone have anything on the protocols used in handling requests
      >> by proxies?[/color]
      >
      > http://en.wikipedia.org/wiki/HTTP
      > http://www.ietf.org/rfc/rfc1945.txt
      > http://www.ietf.org/rfc/rfc2616.txt[/color]

      I guess what I need to find is a tool that will let me see both sides of the
      conversation that a browser has with a server.

      For example.....All webpages are rendered in HTML, at their most basic
      level. So, does the browser get the HTML as a single file, then the CSS
      file, then files referred to in the HTML file (like graphics and such)?

      I will read the RFCs completely to see if my questions are answered there.

      Thanks for the links!

      Jim


      Comment

      • Jochen Kalmbach [MVP]

        #4
        Re: OK....forget the code...how about some pointers?

        Hi Jim![color=blue][color=green]
        >>http://en.wikipedia.org/wiki/HTTP
        >>http://www.ietf.org/rfc/rfc1945.txt
        >>http://www.ietf.org/rfc/rfc2616.txt[/color]
        >
        >
        > I guess what I need to find is a tool that will let me see both sides of the
        > conversation that a browser has with a server.[/color]

        No. This might give you a hint... but what you need to understand is the
        HTTP-Protocol!
        [color=blue]
        > For example.....All webpages are rendered in HTML, at their most basic
        > level. So, does the browser get the HTML as a single file, then the CSS
        > file, then files referred to in the HTML file (like graphics and such)?[/color]

        There are no "files" in the HTTP-protocol... only streams... and every
        "link" has its own request for this data...
        [color=blue]
        > I will read the RFCs completely to see if my questions are answered there.[/color]

        It *will* answer your questions. Thats what RFSs are for.

        --
        Greetings
        Jochen

        My blog about Win32 and .NET

        Comment

        • Mike Labosh

          #5
          Re: OK....forget the code...how about some pointers?

          IMHO, it seems like there is not enough info from the OP:

          At first, it seemed as if he were trying to write a proxy server (Why not
          simply get ISA?)

          If this is the question, then your code will need to bind to the network
          adapter(s) on the localhost so that they can filter / proxy the packets as
          they come through. For best results, look at the Microsoft ISA Server SDK.

          If you are trying to write your own proxy server from scratch, I personally
          think that there are not enough drugs, but here's where you would start:
          Make a Windows Service that listens on TCP Sockets and allows the user to
          specify at runtime what ports should be opened or closed.

          If you are trying to intercept the HTML that a browser requests, have a look
          at HTTPEXPL.EXE, one of the samples that ships on Visual Studio 97
          Enterprise Edition, Disk 1. (I will now pause while you all go scrambling
          through your collections) Source code is included. It displays web pages
          in one pane, and the HTML Source in another, so you can see how it comes
          down. [For everyone else in here] I am uncertain if this unsupported free
          sample is distributable, so I choose not to post the code. But I think it
          should be distributable because it's an interesting piece of work. Perhaps
          an MVP can give us the OK?

          If you are trying to determine the order of download when a browser makes
          the request, (images, css, etc) simply write a test that connects to port
          80, makes a request, and then carefully examine the stream that comes down.

          --
          Peace & happy computing,

          Mike Labosh, MCSD MCT
          "Escriba coda ergo sum." -- vbSensei
          "Jochen Kalmbach [MVP]" <nospam-Jochen.Kalmbach @holzma.de> wrote in message
          news:#KaxO0zHGH A.3728@tk2msftn gp13.phx.gbl...[color=blue]
          > Hi Jim![color=green][color=darkred]
          > >>http://en.wikipedia.org/wiki/HTTP
          > >>http://www.ietf.org/rfc/rfc1945.txt
          > >>http://www.ietf.org/rfc/rfc2616.txt[/color]
          > >
          > >
          > > I guess what I need to find is a tool that will let me see both sides of[/color][/color]
          the[color=blue][color=green]
          > > conversation that a browser has with a server.[/color]
          >
          > No. This might give you a hint... but what you need to understand is the
          > HTTP-Protocol!
          >[color=green]
          > > For example.....All webpages are rendered in HTML, at their most basic
          > > level. So, does the browser get the HTML as a single file, then the CSS
          > > file, then files referred to in the HTML file (like graphics and such)?[/color]
          >
          > There are no "files" in the HTTP-protocol... only streams... and every
          > "link" has its own request for this data...
          >[color=green]
          > > I will read the RFCs completely to see if my questions are answered[/color][/color]
          there.[color=blue]
          >
          > It *will* answer your questions. Thats what RFSs are for.
          >
          > --
          > Greetings
          > Jochen
          >
          > My blog about Win32 and .NET
          > http://blog.kalmbachnet.de/[/color]


          Comment

          • BG

            #6
            Re: OK....forget the code...how about some pointers?


            "Jim" <reply@groups.p lease> wrote in message
            news:yIIAf.2496 $5O2.1674@bigne ws4.bellsouth.n et...[color=blue]
            >
            > "Jochen Kalmbach [MVP]" <nospam-Jochen.Kalmbach @holzma.de> wrote in
            > message news:unBBcEzHGH A.984@tk2msftng p13.phx.gbl...[color=green]
            >> Hi Jim![color=darkred]
            >>> I am trying to write an HTTP/HTTPS proxy server in VB.Net 2005.
            >>>
            >>> But, I don't really even know how the internal workings of a proxy
            >>> should act. Does anyone have anything on the protocols used in handling
            >>> requests by proxies?[/color]
            >>
            >> http://en.wikipedia.org/wiki/HTTP
            >> http://www.ietf.org/rfc/rfc1945.txt
            >> http://www.ietf.org/rfc/rfc2616.txt[/color]
            >
            > I guess what I need to find is a tool that will let me see both sides of
            > the conversation that a browser has with a server.[/color]
            Try ethereal



            Comment

            • Carl Daniel [VC++ MVP]

              #7
              Re: OK....forget the code...how about some pointers?

              Mike Labosh wrote:[color=blue]
              >I am
              > uncertain if this unsupported free sample is distributable, so I
              > choose not to post the code. But I think it should be distributable
              > because it's an interesting piece of work. Perhaps an MVP can give
              > us the OK?[/color]

              MVPs have no authority to give any such OK.

              That said, in my experience unsupported free samples have always been
              distributable, but the EULA from VS97 would be the definitive source of an
              answer to that question.

              -cd


              Comment

              • Ken Wilson

                #8
                Re: OK....forget the code...how about some pointers?

                On Sun, 22 Jan 2006 03:43:51 -0500, "Jim" <reply@groups.p lease> wrote:
                [color=blue]
                >I am trying to write an HTTP/HTTPS proxy server in VB.Net 2005.
                >
                >But, I don't really even know how the internal workings of a proxy should
                >act. Does anyone have anything on the protocols used in handling requests by
                >proxies?
                >
                >I have Googled my eyes out....and found nothing.
                >
                >(BTW, props to Google for refusing the ridiculous request for their search
                >results.)
                >
                >Jim
                >[/color]
                They may have something here.



                Ken Wilson
                Seeking viable employment in Victoria, BC

                Comment

                • Mike Labosh

                  #9
                  Re: OK....forget the code...how about some pointers?

                  > > uncertain if this unsupported free sample is distributable, so I[color=blue][color=green]
                  > > choose not to post the code. But I think it should be distributable
                  > > because it's an interesting piece of work. Perhaps an MVP can give
                  > > us the OK?[/color]
                  >
                  > MVPs have no authority to give any such OK.[/color]

                  Poor phrasing on my part. I know this.
                  [color=blue]
                  > That said, in my experience unsupported free samples have always been
                  > distributable, but the EULA from VS97 would be the definitive source of an
                  > answer to that question.[/color]

                  This is what I meant, that an MVP would know better than me whether it is,
                  not make the decision. I will go look at the EULA.

                  --
                  Peace & happy computing,

                  Mike Labosh, MCSD MCT
                  "Escriba coda ergo sum." -- vbSensei


                  Comment

                  • Peter Oliphant

                    #10
                    Re: OK....forget the code...how about some pointers?

                    Here's an interesting question. What binds a person to obey the EULA? I
                    imagine you can't be held to its terms unless you buy the product itself.

                    So, can a person who has not bought a product free to violate the product's
                    EULA (assuming such actions are not against the law in and of themselves)?

                    I ask this because your response to "can the sample code be posted?" implies
                    the EULA is the 'authority' on this subject. But if someone has not bought
                    the product themselves (say, a relative or friend) then they could post such
                    sample code if the EULA is all that would be violated. So why not allow
                    someone who HAS bought the product from doing it too?

                    This is kind of ass-backwards in a certain sense. It seems someone who buys
                    the product will have less rights (in some situations) than someone who
                    didn't. I make this point since I think the EULA should never limit someone
                    more than someone who hasn't bought the product. That is, it should let you
                    know the limit of your *NEW* CAPABILITIES made possiblr by the product
                    you've bought, and not increase your EXISTING restrictions. It should make
                    clear what NOBODY can do, not what the person who bought the product can't
                    do. And if someone who hasn't bought the product CAN do something, then the
                    EULA should not restrict someone who has bought the product from doing it.
                    It's a sublte point, but it makes sense...

                    Note that a person who has not bought the product has no access to many
                    elements of the product, so their inability to do some actions is 'physical'
                    (that is, they *can't* do it in contrast to the are *not allowed* to do it).
                    For example, a person who doesn't have a legal copy still can't make other
                    copies and distribute. So, I'm not implying a person who hasn't bought the
                    product can violate, say, copyright rules (since these a based on common
                    law, not 'contract law' imposed by a Eula)...

                    [==P==]

                    PS - I would have posted this in the 'general' section; but this is a
                    response to a post here, so I feel it's an approriate place to post this...

                    "Carl Daniel [VC++ MVP]" <cpdaniel_remov e_this_and_nosp am@mvps.org.nos pam>
                    wrote in message news:uhDtpn2HGH A.2444@TK2MSFTN GP11.phx.gbl...[color=blue]
                    > Mike Labosh wrote:[color=green]
                    >>I am
                    >> uncertain if this unsupported free sample is distributable, so I
                    >> choose not to post the code. But I think it should be distributable
                    >> because it's an interesting piece of work. Perhaps an MVP can give
                    >> us the OK?[/color]
                    >
                    > MVPs have no authority to give any such OK.
                    >
                    > That said, in my experience unsupported free samples have always been
                    > distributable, but the EULA from VS97 would be the definitive source of an
                    > answer to that question.
                    >
                    > -cd
                    >
                    >[/color]


                    Comment

                    • Herfried K. Wagner [MVP]

                      #11
                      Re: OK....forget the code...how about some pointers?

                      "Peter Oliphant" <poliphant@Roun dTripInc.com> schrieb:[color=blue]
                      > Here's an interesting question. What binds a person to obey the EULA? I
                      > imagine you can't be held to its terms unless you buy the product itself.[/color]

                      Does not having a drivers license grant you the right to drive as fast as
                      you want?

                      There are several other laws which prevent the manufacturer's rights
                      (copyright in the U.S., "Urheberrec ht" in Germany and Austria, for example).

                      --
                      M S Herfried K. Wagner
                      M V P <URL:http://dotnet.mvps.org/>
                      V B <URL:http://classicvb.org/petition/>

                      Comment

                      • Jay B. Harlow [MVP - Outlook]

                        #12
                        Re: OK....forget the code...how about some pointers?

                        | There are several other laws which prevent the manufacturer's rights
                        | (copyright in the U.S., "Urheberrec ht" in Germany and Austria, for
                        example).
                        "prevent" or did you perhaps mean "protect"?

                        --
                        Hope this helps
                        Jay [MVP - Outlook]
                        ..NET Application Architect, Enthusiast, & Evangelist
                        T.S. Bradley - http://www.tsbradley.net


                        "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
                        news:%2332GhbgI GHA.3984@TK2MSF TNGP14.phx.gbl. ..
                        | "Peter Oliphant" <poliphant@Roun dTripInc.com> schrieb:
                        | > Here's an interesting question. What binds a person to obey the EULA? I
                        | > imagine you can't be held to its terms unless you buy the product
                        itself.
                        |
                        | Does not having a drivers license grant you the right to drive as fast as
                        | you want?
                        |
                        | There are several other laws which prevent the manufacturer's rights
                        | (copyright in the U.S., "Urheberrec ht" in Germany and Austria, for
                        example).
                        |
                        | --
                        | M S Herfried K. Wagner
                        | M V P <URL:http://dotnet.mvps.org/>
                        | V B <URL:http://classicvb.org/petition/>
                        |


                        Comment

                        • Herfried K. Wagner [MVP]

                          #13
                          Re: OK....forget the code...how about some pointers?

                          Jay,

                          "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow_MVP @tsbradley.net> schrieb:[color=blue]
                          >| There are several other laws which prevent the manufacturer's rights
                          > | (copyright in the U.S., "Urheberrec ht" in Germany and Austria, for
                          > example).
                          > "prevent" or did you perhaps mean "protect"?[/color]

                          Ooops. I actually wanted to type "protect". Thank you for pointing this
                          important detail out!

                          --
                          M S Herfried K. Wagner
                          M V P <URL:http://dotnet.mvps.org/>
                          V B <URL:http://classicvb.org/petition/>

                          Comment

                          • Nick Hounsome

                            #14
                            Re: OK....forget the code...how about some pointers?

                            If you have not bought a piece of code and nobody who has bought it has the
                            right to publish it then how could you ever have seen it to publish it
                            yourself?

                            If you reply that you just got hold of it when someone else published it
                            illegally that is not good enough - It is the equivalent to saying that you
                            can keep someones wallet if a thief steals it and then leaves it lying
                            around for you to pick up.

                            "Peter Oliphant" <poliphant@Roun dTripInc.com> wrote in message
                            news:e6GBw$fIGH A.3936@TK2MSFTN GP10.phx.gbl...[color=blue]
                            > Here's an interesting question. What binds a person to obey the EULA? I
                            > imagine you can't be held to its terms unless you buy the product itself.
                            >
                            > So, can a person who has not bought a product free to violate the
                            > product's EULA (assuming such actions are not against the law in and of
                            > themselves)?
                            >
                            > I ask this because your response to "can the sample code be posted?"
                            > implies the EULA is the 'authority' on this subject. But if someone has
                            > not bought the product themselves (say, a relative or friend) then they
                            > could post such sample code if the EULA is all that would be violated. So
                            > why not allow someone who HAS bought the product from doing it too?
                            >
                            > This is kind of ass-backwards in a certain sense. It seems someone who
                            > buys the product will have less rights (in some situations) than someone
                            > who didn't. I make this point since I think the EULA should never limit
                            > someone more than someone who hasn't bought the product. That is, it
                            > should let you know the limit of your *NEW* CAPABILITIES made possiblr by
                            > the product you've bought, and not increase your EXISTING restrictions. It
                            > should make clear what NOBODY can do, not what the person who bought the
                            > product can't do. And if someone who hasn't bought the product CAN do
                            > something, then the EULA should not restrict someone who has bought the
                            > product from doing it. It's a sublte point, but it makes sense...
                            >
                            > Note that a person who has not bought the product has no access to many
                            > elements of the product, so their inability to do some actions is
                            > 'physical' (that is, they *can't* do it in contrast to the are *not
                            > allowed* to do it). For example, a person who doesn't have a legal copy
                            > still can't make other copies and distribute. So, I'm not implying a
                            > person who hasn't bought the product can violate, say, copyright rules
                            > (since these a based on common law, not 'contract law' imposed by a
                            > Eula)...
                            >
                            > [==P==]
                            >
                            > PS - I would have posted this in the 'general' section; but this is a
                            > response to a post here, so I feel it's an approriate place to post
                            > this...
                            >
                            > "Carl Daniel [VC++ MVP]" <cpdaniel_remov e_this_and_nosp am@mvps.org.nos pam>
                            > wrote in message news:uhDtpn2HGH A.2444@TK2MSFTN GP11.phx.gbl...[color=green]
                            >> Mike Labosh wrote:[color=darkred]
                            >>>I am
                            >>> uncertain if this unsupported free sample is distributable, so I
                            >>> choose not to post the code. But I think it should be distributable
                            >>> because it's an interesting piece of work. Perhaps an MVP can give
                            >>> us the OK?[/color]
                            >>
                            >> MVPs have no authority to give any such OK.
                            >>
                            >> That said, in my experience unsupported free samples have always been
                            >> distributable, but the EULA from VS97 would be the definitive source of
                            >> an answer to that question.
                            >>
                            >> -cd
                            >>
                            >>[/color]
                            >
                            >[/color]


                            Comment

                            • Peter Oliphant

                              #15
                              Re: OK....forget the code...how about some pointers?

                              >>Does not having a drivers license grant you the right to drive as fast as[color=blue][color=green]
                              >>you want?[/color][/color]

                              No. But that's why I said one would still be bound by PUBLIC law. Using your
                              analogy, when you buy a car does the manufacturer of the car require you to
                              sign a document establishing contractually legally binding rules you must
                              follow when driving the car you bought from them that did not pre-exist
                              BEFORE you bought the car?

                              No. Typically when buy something the manufacturer does not impose
                              restrictions you didn't have before. Heck, one typically buys a product to
                              extend one's capabilities, not have the restricted?

                              I want to be very clear here. In this thread, someone asked if they could
                              post some source code. Someone else said it was up to the EULA. I'm saying
                              it shouldn't be up to the EULA. If it's legal for someone to do who hasn't
                              bought the product it should also be legal for someone to do it who HAS
                              bought the product...

                              [==P==]

                              "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
                              news:%2332GhbgI GHA.3984@TK2MSF TNGP14.phx.gbl. ..[color=blue]
                              > "Peter Oliphant" <poliphant@Roun dTripInc.com> schrieb:[color=green]
                              >> Here's an interesting question. What binds a person to obey the EULA? I
                              >> imagine you can't be held to its terms unless you buy the product itself.[/color]
                              >
                              > Does not having a drivers license grant you the right to drive as fast as
                              > you want?
                              >
                              > There are several other laws which prevent the manufacturer's rights
                              > (copyright in the U.S., "Urheberrec ht" in Germany and Austria, for
                              > example).
                              >
                              > --
                              > M S Herfried K. Wagner
                              > M V P <URL:http://dotnet.mvps.org/>
                              > V B <URL:http://classicvb.org/petition/>[/color]


                              Comment

                              Working...