• AVR Freaks

Hot!Can http_net module redirect http to https connection?

Author
suprastar
Starting Member
  • Total Posts : 45
  • Reward points : 0
  • Joined: 2016/03/31 00:19:28
  • Location: 0
  • Status: offline
2017/09/18 23:42:27 (permalink)
0

Can http_net module redirect http to https connection?

I am wondering, is it possible for the http_net server to listen to port 80 for incoming connections, and then redirect them to port 443?
 
My application has an https server, but people frequently forget to type in thet https:// before the IP address.
Is there a way, in Harmony v2.03, to have a simple listener on port 80 that would redirect the traffic to port 443?
 
I figure it can be implemented, but I am asking if it is supported in Harmony.
#1

5 Replies Related Threads

    u/chip
    Starting Member
    • Total Posts : 38
    • Reward points : 0
    • Joined: 2017/03/27 12:14:09
    • Location: 0
    • Status: offline
    Re: Can http_net module redirect http to https connection? 2017/11/21 13:23:46 (permalink)
    0
    Hi,
     
    Were you able to figure out how to redirect port 80 traffic to ssl?
    If you could share your findings that would be great.
     
     
    Thanks,
    Ed
    #2
    Jim Nickerson
    User 452
    • Total Posts : 6322
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: Can http_net module redirect http to https connection? 2017/11/22 09:47:07 (permalink)
    4 (1)
    #3
    suprastar
    Starting Member
    • Total Posts : 45
    • Reward points : 0
    • Joined: 2016/03/31 00:19:28
    • Location: 0
    • Status: offline
    Re: Can http_net module redirect http to https connection? 2017/12/05 06:57:35 (permalink)
    0
    JANickerson
    something like this maybe https://developer.mozilla.../Web/HTTP/Redirections




    This is the basic idea, however, the question is how to implement a small listener on port 80 to perform these redirects.
     
    Ed, sorry about the delay, I haven't been working on it since. If it is of interest to you, be asured that I will notify this thread if I ever succeed, however, this is not my top priority at the moment.
    #4
    u/chip
    Starting Member
    • Total Posts : 38
    • Reward points : 0
    • Joined: 2017/03/27 12:14:09
    • Location: 0
    • Status: offline
    Re: Can http_net module redirect http to https connection? 2017/12/06 10:02:41 (permalink)
    0
    @suprastar, no worries I haven't been actively working on this myself.
    Thanks Jim for the idea. I tried to implement it by adding a second NET_PRES instance in harmony (v2.04), but I didn't see where I could specify a second listening port. I don't think this was the right approach.
     
     
    Ed
    #5
    danwood76
    New Member
    • Total Posts : 4
    • Reward points : 0
    • Joined: 2007/09/10 07:27:43
    • Location: 0
    • Status: offline
    Re: Can http_net module redirect http to https connection? 2019/08/01 06:43:55 (permalink)
    0
    If anyone stumbles on to this thread an wants a solution/answer.
     
    I created a simple TCP server based on the harmony examples that listens on port 80.
     
    When it receives a TCP packet with an HTTP "GET" request (first 3 bytes are "GET") it simply responds:
    "HTTP/1.1 301 Moved Permanently\nLocation: https://{INSERT_DEVICE_IP}/\n"
     
    And closes the connection, very simple and works well.
     
    Unfortunately I cannot post a code example as it is part of a larger project but following the simple TCP server example should enable you to create a working solution.
    #6
    Jump to:
    © 2019 APG vNext Commercial Version 4.5