How to connect DataSnap client to DataSnap server via proxy server?
The problem is this:
I decided to make a messenger/chat (VCL application) with callback on DataSnap technology (IDE Delphi XE6), has created a simple DataSnap server (tcp / ip + http) without the database, and thick client.
All works fine if the whole thing run on a local network (tcp / ip) or via the Internet (http).Problems arise when run over HTTP and the client machine has a HTTP proxy server, the client application can not connect to my DataSnap server application. Client application gets error " 10061 connection refused
" or " Expected datasnap context in request http://[YourServerIP]:[YourPort]/datasnap/tunnel
" .
I tried to enter IP and port of the proxy server to params of component TSQLConnection.Driver
params DSProxyHost
and DSProxyPort
, turned off my firewall and antivirus software, checked allows traffic to the proxy ip + port, but the problem has not disappeared.
After few days searches, without results, i decided listening requests from client application and response of my DataSnap Server application in HTTPTrace
procedure of DSHTTPService1
component, also with software HTTPDebugerPro, and i noticed interesting thing:
URI
with this text " /datasnap/tunnel
" and all works fine ds server response " 200, OK
" . URI
with text " http://[YourServerIP]:[YourPort]/datasnap/tunnel
" and raised exception with response error " 404, Expected datasnap context in request http://YourServerIP:YourPort/datasnap/tunnel
" . Has anyone knows solution about this problem? How to connect DataSnap client to DataSnap server via proxy server? I searched solution for this problem several days, I shoveled the Internet but have not yet found a solution.
链接地址: http://www.djcxy.com/p/64688.html