The project works for HTTP Server (Web Hosted). But when i run httpbin in docker on the local machine (Win 10), i can’t connect it always return this error. Please can someone write instructions on what i need to do? Thanks.
8 5400 [HTTPSDemo] [ERROR][NET][5400] Failed to establish new connection. Socket status -116.
9 5401 [HTTPSDemo] [ERROR][HTTPS Client][5401] Failed to connect to the server at … on port 80 with error: 4
10 5401 [HTTPSDemo] [ERROR][HTTPS Client][5401] Error in IotHttpsClient_Connect(). Error code 203.
Were you able to follow the instructions here in order to set up httpbin in the docker container with port mapping (i.e. by running docker run -p 80:80 kennethreitz/httpbin), as well as update httpsdemoprofileSERVER_ADDRESS in https_demo_profile.h?
Can you confirm that httpbin is running by either curling localhost or accessing http://localhost:80 in a web browser?
Thank you for your replay. Yes it’s running on localhost, and i also edit
httpsdemoprofileSERVER_ADDRESS to my IP address and there is a problem with the connection. Do I need to do some more configuration for Host Machine ?
Have you already tried setting httpsdemoprofileSERVER_ADDRESS to 127.0.0.1? Does curling 127.0.0.1 give you the same html page that is hosted on httpbin.org?
Additionally, can you supply the entire debug log that gets printed to the console when running the http_plain_text demo?
Can you enable network debug logs in iot_config.h, as well as debug logging for FreeRTOS+TCP in FreeRTOSIPConfig.h?
Additionally, can you capture your packets using Wireshark? You can compare the differences between your test against httpbin.org and your test against localhost.
What’s the IP address assigned to the HTTP Client (should be around line 10 of the debug log)? It doesn’t seem to be part of your screenshot. Also, in the future, you can simply just paste the console output in a code block in your post, or upload it here compressed into a .zip or .tar.
There only seem to be 41 packets in the capture, and only 2 related to 192.168.0.114 (both DHCP). There definitely should be more packets. Can you run the capture again, this time starting before you run the demo, and stopping after it crashes?
It would also be helpful if you were to supply the packet capture of a successful run against httpbin.org, also starting before the demo, and stopping the capture after the first iteration succeeds. You can compress both captures into a .zip and upload it here directly.
Thanks