Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. proxy pass https question

proxy pass https question

Scheduled Pinned Locked Moved C#
csharphelpapachecomadobe
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    steven shingler
    wrote on last edited by
    #1

    Hi all, I have a tricky situation, with which I would very much appreciate a little advice: I have a C# Control for embedding a flash swf in a page. The 'codebase' and 'pluginspage' attributes of the object tag require urls (e.g. http://www.macromedia.com/go/getflashplayer) If the page is being served over https, of course that url should change to: https://www.macromedia.com/go/getflashplayer ...to prevent the browser alerting you about mixing secure and non-secure objects. Now here's the problem: Our hosting environment has a linux server as the only outward-facing IP, and we are using the apache proxy pass module to serve our .net sites from a windows machine. So the linux box serves on http or https. The windows box is only http. My C# control, sitting on the windows box needs to know which to embed the flash as. I hoped I could use the IsSecureConnection property of the request object, but that only sees the request from the linux box, which is http. The full path of the url is no help either - same thing. I hope I have explained this sufficiently well. If anyone has any ideas I would love to hear them. Many thanks Steven

    H 1 Reply Last reply
    0
    • S steven shingler

      Hi all, I have a tricky situation, with which I would very much appreciate a little advice: I have a C# Control for embedding a flash swf in a page. The 'codebase' and 'pluginspage' attributes of the object tag require urls (e.g. http://www.macromedia.com/go/getflashplayer) If the page is being served over https, of course that url should change to: https://www.macromedia.com/go/getflashplayer ...to prevent the browser alerting you about mixing secure and non-secure objects. Now here's the problem: Our hosting environment has a linux server as the only outward-facing IP, and we are using the apache proxy pass module to serve our .net sites from a windows machine. So the linux box serves on http or https. The windows box is only http. My C# control, sitting on the windows box needs to know which to embed the flash as. I hoped I could use the IsSecureConnection property of the request object, but that only sees the request from the linux box, which is http. The full path of the url is no help either - same thing. I hope I have explained this sufficiently well. If anyone has any ideas I would love to hear them. Many thanks Steven

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      Any future questions about ASP.NET (in any language) should actually be posted in the ASP.NET[^] forum. ASP.NET will only know what it is asked. If the linux box is asking requesting a resource over HTTP, that's all it will know. You need some way to tell the Windows box which is being requested. I recommend taking a look at the apache mod APIs for that caching proxy mod you're using to see if there's any exported APIs, otherwise there's really no way to tell. One more idea is to actually have to separate URLs (they could map the same directory/file, though) so that the ASP.NET page (or whatever) can easily distinguish between the two requests. You can't use IIS's virtual directory functionality because this will actually create a separate web application with a different AppDomains. Instead, you could either use two separate pages or use a custom IHttpHandler implementation which is pretty easy. Read a recent article in MSDN, Serving Dynamic Content with HTTP Handlers[^], for a good example and discussion.

      Microsoft MVP, Visual C# My Articles

      S 1 Reply Last reply
      0
      • H Heath Stewart

        Any future questions about ASP.NET (in any language) should actually be posted in the ASP.NET[^] forum. ASP.NET will only know what it is asked. If the linux box is asking requesting a resource over HTTP, that's all it will know. You need some way to tell the Windows box which is being requested. I recommend taking a look at the apache mod APIs for that caching proxy mod you're using to see if there's any exported APIs, otherwise there's really no way to tell. One more idea is to actually have to separate URLs (they could map the same directory/file, though) so that the ASP.NET page (or whatever) can easily distinguish between the two requests. You can't use IIS's virtual directory functionality because this will actually create a separate web application with a different AppDomains. Instead, you could either use two separate pages or use a custom IHttpHandler implementation which is pretty easy. Read a recent article in MSDN, Serving Dynamic Content with HTTP Handlers[^], for a good example and discussion.

        Microsoft MVP, Visual C# My Articles

        S Offline
        S Offline
        steven shingler
        wrote on last edited by
        #3

        Hi Heath, Thank you so much for replying so fully, and I'm sorry I haven't got back to you till now. Point taken about which forum this should be on. The separate URL idea could be a winner, also I noticed the REMOTE_PORT header variable is different in both cases so may be able to do something there. I read the articles on HTTP Handlers, thank you - very interesting. In fact though, I thought of a rather lazy, well - frankly low down and dirty way of getting around this: I can just have the codebase url as https the whole time! It seems to work perfectly well and is certainly a lot more straight forward. Do you think this is sufficient? Thank you again for getting back to me Best Wishes Steven

        H 1 Reply Last reply
        0
        • S steven shingler

          Hi Heath, Thank you so much for replying so fully, and I'm sorry I haven't got back to you till now. Point taken about which forum this should be on. The separate URL idea could be a winner, also I noticed the REMOTE_PORT header variable is different in both cases so may be able to do something there. I read the articles on HTTP Handlers, thank you - very interesting. In fact though, I thought of a rather lazy, well - frankly low down and dirty way of getting around this: I can just have the codebase url as https the whole time! It seems to work perfectly well and is certainly a lot more straight forward. Do you think this is sufficient? Thank you again for getting back to me Best Wishes Steven

          H Offline
          H Offline
          Heath Stewart
          wrote on last edited by
          #4

          It would work, but you're putting an extra burden on the client and server to encrypt communications to send the control(s). It may be negligible, however, so it really is up to your implementation.

          Microsoft MVP, Visual C# My Articles

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups