• Now I use a SIM7600CE for 4G connection. The modules didn't adapt for this kind of sim card.
    So I have to write my own module for it.

    Now I can get response datas in this Method:

    recv: function (sckt, maxLen) {
        if (sockData[sckt]) {
          var r;
          console.log("recv", sockData[sckt].length);
          if (sockData[sckt].length > maxLen) {
            r = sockData[sckt].substr(0, maxLen);
            sockData[sckt] = sockData[sckt].substr(maxLen);
            console.log("recv", sockData[sckt]);
          } else {
            r = sockData[sckt];
            sockData[sckt] = "";
            console.log("recv | socks[sckt]", socks[sckt]);
            if (socks[sckt] == "DataClose") {
              dbg("Got DataClose - forcing close");
              socks[sckt] = "closing";
            }
          }
          console.log("[recv data]", r)
          return r;
        }
        if (socks[sckt] == "closing" || !socks[sckt]) return -1; // close it
        return "";
      },
    

    I think this part is the place where return datas to http.get().
    But I can't recieve any datas in this place.
    Do you have any introductions about how the datas flow in the network?

    http.get("http://www.pur3.co.uk/hello.tx­t", function (res) {
          let str = ''; 
          res.on('data', chunk => {
            console.log("chunk",chunk);
            str += chunk;
          });
          res.on('end', () => {
            console.log("result: --->   ", str);
          });
        });
    
About

Avatar for user109783 @user109783 started