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] Failed to establish new connection. Socket status -116.
9 5401 [HTTPSDemo] [ERROR][HTTPS Client] Failed to connect to the server at … on port 80 with error: 4
10 5401 [HTTPSDemo] [ERROR][HTTPS Client] 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
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
This is my current status
Just to confirm, the result in both cases is exactly the same when connecting to 127.0.0.1 instead of 192.168.0.40, correct?
Yes i tried both ways but the result is the same.
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.
Thank you for your answer. It looks that is a problem with source and destination packets, can you give some hints about how can i solve this.
What is the problem you have observed specifically? Can you upload your Wireshark packet captures?
Can you upload the *.pcapng packet capture files exported from Wireshark?
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.
http client : 192.168.0.114
httpbin.org works fine, what’s the problem with localhost?
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.
I found a solution in FreeRTOSConfig.h, configNETWORK_INTERFACE_TO_USE needs change to 2 for localhost.