Accessing the MySQL database of the intranet host through libssh2 lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- myisjwj · 2023-07-17 02:26 I have connected to the remote external host using Libssh2, and now I want to map the port of the internal host to 127.0.0.1. The code is as follows: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i     localPort := 33069;    tunnelSock := fpSocket(AF_INET, SOCK_STREAM, 0);    FillChar(tunnelAddr, SizeOf(tunnelAddr), 0);    tunnelAddr.sin_family := AF_INET;    tunnelAddr.sin_port := htons(localPort);    tunnelAddr.sin_addr.S_addr := INADDR_ANY;    rc := fpBind(tunnelSock, @tunnelAddr, SizeOf(tunnelAddr));    rc := fpListen(tunnelSock, 1);    channel1:=libssh2_channel_direct_tcpip_ex(session1, '192.168.0.77', 3306, '127.0.0.1', localPort); But now MySQL cannot connect to the intranet host. The error is: MySQL waiting for initial communication packet. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i     rc := fpBind(tunnelSock, @tunnelAddr, SizeOf(tunnelAddr));    rc := fpListen(tunnelSock, 1);    channel1:=libssh2_channel_direct_tcpip_ex(session1, '192.168.0.77', 3306, '127.0.0.1', localPort); All return to normal.