Incomprehensible load from the TCP IN node - Solved

Good evening everyone.
Using the TCPin node, I created a Web-server for a device that is a Web-client.
The Web-server listens on port 50001.
The Web-client documentation says that it should send a request like:

{
    "type":"Z5R",
    "messages":
        [{
            "id":1234567890,
            "operation":"power_on"
        }]
}

and the Web-server should respond to it:

{
    "date":"2022-11-02 12:00:00",
    " messages":
        [{
            "id":0123456789,
            "operation":"set_active"
        ]}
}

But something else comes to TCPin:

{
    "payload": "POST / HTTP/1.1\r\nHost: 192.168.11.123:50001\r\nAccept: */*\r\nUser-Agent: Z5R WEB\r\nConection: close\r\nContent-type: application/json\r\nContent-Length: 197\r\n\r\n{\"type\":\"Z5R\",\"messages\":[{\"id\":1681692777,\"operation\":\"power_on\"}]}",
    "ip": "::ffff:192.168.11.134",
    "port": 59708,
    "_session": {
        "type": "tcp",
        "id": "fb857367.081b8"
    },
    "_msgid": "ecae1f3.13a8fe"
}

And now the questions:

  1. Why does such content come - is it the wrong behavior of the Web-client?
  2. What kind of load should the Web-server send with such a request?

Using the TCPin node, I created a Web-server

I am a bit puzzled. The tcp nodes are for tcp connections, the http nodes are for http connections
You are receiving http input, why not using http-in + http response nodes to create a webserver ?

1 Like

Thank you so much for noticing my mistake, which I haven't seen for 2 days of failures !
I changed node "TCP In" to "HTTP In" and everything worked !

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.