Announcement

Collapse
No announcement yet.

How to FTP connect via non-transparent proxy?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #21
    Code:
    URL = "ftp://" & szProxyUser & ":" & szProxyPass + "@" + szProxyAddrPort
    220 Proxy+ FTP Gateway ready. Start with command USER [email protected]
    331 [gateway] Enter a password known on 127.0.0.1
    530 [gateway] login incorrect

    Code:
    URL = "ftp://" & szProxyUser & "/" & szProxyPass + "@" + szProxyAddrPort
    220 Proxy+ FTP Gateway ready. Start with command USER [email protected]
    331 [gateway] Enter a password known on proxy_test
    530 [gateway] login incorrect

    Code:
    URL = "ftp://" & szProxyUser & "(" & szProxyPass + ")@" + szProxyAddrPort
    220 Proxy+ FTP Gateway ready. Start with command USER [email protected]
    331 [gateway] Enter a password known on proxy_test
    500 [gateway] authentication required or unknown command

    Yours sincerely

    Comment


    • #22
      >220 Proxy+ FTP Gateway ready. Start with command USER [email protected]
      >331 [gateway] Enter a password known on proxy_test

      From command mode (FTP.EXE), try this at this point:

      Code:
      FTP>  USER  username/[email protected]
      If that works, then you need to use the FtpCommand function to send that string in your program.

      Well I suppose you could just try FtpCommand from your program with
      Code:
       szCmd = "USER " & userName$ & "/" & password$ & "@" & hostname$
       iret     =  FtpCommand (hConnect, trueorfalse, falgs, szCmd...)
      You may or may not need a space after password$ and before the "@" sign....

      MCM
      Michael Mattias
      Tal Systems (retired)
      Port Washington WI USA
      [email protected]
      http://www.talsystems.com

      Comment


      • #23
        I tried, no, does not work.
        hInetConnect = 0 !!!
        How can work this?
        iret = FtpCommand (???, trueorfalse, falgs, szCmd...)

        Example please.

        Thanks.
        Last edited by Alexander Holzer; 6 Mar 2009, 03:38 PM.
        Yours sincerely

        Comment


        • #24
          > hInetConnect = 0 !!!
          Are you sure you even have an hInetOpen from InternetOpen?

          Your internetOpen looks funny...
          Code:
          HINTERNET InternetOpen(
            LPCTSTR lpszAgent,
            DWORD dwAccessType,
            LPCTSTR lpszProxyName,
            LPCTSTR lpszProxyBypass,
            DWORD dwFlags
          );
          LpszProxyName:
          Value Meaning
          INTERNET_OPEN_TYPE_DIRECT Resolves all host names locally.
          INTERNET_OPEN_TYPE_PRECONFIG Retrieves the proxy or direct configuration from the registry.
          INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY Retrieves the proxy or direct configuration from the registry and prevents the use of a startup Microsoft® JScript® or Internet Setup (INS) file.
          INTERNET_OPEN_TYPE_PROXY Passes requests to the proxy unless a proxy bypass list is supplied and the name to be resolved bypasses the proxy. In this case, the function uses INTERNET_OPEN_TYPE_DIRECT.

          lpszProxyName
          [in] Pointer to a null-terminated string that specifies the name of the proxy server(s) to use when proxy access is specified by setting dwAccessType to INTERNET_OPEN_TYPE_PROXY. Do not use an empty string, because InternetOpen will use it as the proxy name. The WinINet functions recognize only CERN type proxies (HTTP only) and the TIS FTP gateway (FTP only). If Microsoft Internet Explorer is installed, these functions also support SOCKS proxies. FTP and Gopher requests can be made through a CERN type proxy either by changing them to an HTTP request or by using InternetOpenUrl. If dwAccessType is not set to INTERNET_OPEN_TYPE_PROXY, this parameter is ignored and should be NULL. For more information about listing proxy servers, see the Listing Proxy Servers section of Enabling Internet Functionality.
          lpszProxyBypass
          You need to make a much better record of each call, its result and the corresponding message.

          MCM
          Michael Mattias
          Tal Systems (retired)
          Port Washington WI USA
          [email protected]
          http://www.talsystems.com

          Comment


          • #25
            Hello Michael,
            does it supply InternetOpen(..) "results", as InternetGetLastResponseInfo?
            I receive always "result" = 0 (%FALSE)
            InternetGetLastResponseInfo works for me at InternetConnect(..), InternetOpenUrl(..)
            In the same way does not work handle from InternetOpen(..) for FtpCommand(..), it functions only if handle from InternetConnect came.

            http://msdn.microsoft.com/en-us/libr...33(VS.85).aspx

            hConnect [in]

            A handle returned from a call to InternetConnect.
            ..not from InternetOpen


            If hConnect = 0 (or FALSE), then no chance for FtpCommand(..)

            All otherwise easily would be solved by means of FtpCommand(..):
            > open proxy.mycompany.com 1234
            > user ....
            ..etc.
            Last edited by Alexander Holzer; 6 Mar 2009, 05:28 PM.
            Yours sincerely

            Comment


            • #26
              Sorry, Alexander, but there is no more blood in this particular turnip.
              Michael Mattias
              Tal Systems (retired)
              Port Washington WI USA
              [email protected]
              http://www.talsystems.com

              Comment


              • #27
                Question to experts on the Internet (PBWin programmers):
                - whether probably in PBwin to realize connection through a proxy/fiewall-proxy (with authentication)?

                Can it essentially a problem for PBwin?
                ..and I look in vain for the solution?

                Thanks
                Yours sincerely

                Comment


                • #28
                  Well, maybe there's a few drops left.....

                  Maybe you are just firewalled OUT by the server, as per post #5?

                  Using command-line FTP should tell you that right away.
                  Michael Mattias
                  Tal Systems (retired)
                  Port Washington WI USA
                  [email protected]
                  http://www.talsystems.com

                  Comment


                  • #29
                    Originally posted by Michael Mattias View Post
                    Well, maybe there's a few drops left.....

                    Maybe you are just firewalled OUT by the server, as per post #5?
                    I would like in my app to realize the ftp connection through firewall-proxy as in Total Commander (FTP connection details -> Use firewall (proxy server) ... etc.)
                    http://www.ghisler.com/featurel.htm (FTP client: ..)
                    It works with proxy or firewall (with authentication) without problem also with several variants of connect methods by firewall/proxy server.

                    Originally posted by Michael Mattias View Post
                    Using command-line FTP should tell you that right away.
                    I tried all possible variants out, but witout success!

                    Therefore my question:
                    - does someone a safe connection with ftp server (firewall/proxy with authentication) with PBwin program?
                    Is it possible? example pls.
                    Last edited by Alexander Holzer; 7 Mar 2009, 12:05 PM.
                    Yours sincerely

                    Comment


                    • #30
                      InternetConnect or InternetOpenUrl
                      and all possible combinations with username, password, hostname
                      530 [gateway] login incorrect

                      ftp.exe works without problem:
                      open hostname
                      user username password @hostname
                      ...

                      Works WinInet with proxy and ftp-gateway not correctly?
                      I did not have yet this function!
                      Yours sincerely

                      Comment


                      • #31
                        I use now no WinInet, but the TCP protocol over Winsock.
                        It works without problems.
                        Yours sincerely

                        Comment


                        • #32
                          I think after three pages of asking and attempts to help by multiple individuals it might be nice to post what worked.
                          Michael Mattias
                          Tal Systems (retired)
                          Port Washington WI USA
                          [email protected]
                          http://www.talsystems.com

                          Comment

                          Working...
                          X