aws-samples / aws-iot-securetunneling-localproxy

AWS Iot Secure Tunneling local proxy reference C++ implementation
https://docs.aws.amazon.com/iot/latest/developerguide/what-is-secure-tunneling.html
Apache License 2.0
74 stars 71 forks source link

Add HTTP proxy support #56

Closed kareali closed 3 years ago

kareali commented 3 years ago

Motivation

Modifications

Change summary

  1. Refactored the tcp_proxy_config into a separate header file and renamed it to LocalproxyConfig to make it easier to use with the new component. And added some field descriptions.
  2. Added a field for the tcp_adapter_proxy class for the HttpsProxyAdapter.
  3. Separated out the TCP socket definition from the websocket stream definition to make it accessible.
  4. Added implementation for HttpsProxyAdapter class.
  5. Added integration for HttpsProxyAdapter errors and boost errors
  6. Added code that starts an HTTP server that I can use to test against
  7. Added unit test cases for the public methods in the HttpsProxyAdapter class
  8. Added a wrapper around Boost websocket stream so that the caller won't have to worry about the underlying websocket stream type which will vary based on whether the web proxy connection is over TLS or not.
  9. Updated the HttpsProxyAdapter to perform the SSL handshake with the web proxy before sending HTTP CONNECT when needed.
  10. Updated the main function to accept https_proxy URLs with HTTPS protocol.
  11. Adjusted the unit tests.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.