login about faq

I'm trying to setup an ssh tunnel for a connection to a remote database using Xojo.

I've looked at the examples but I don't see properties in the Xojo autocomplete list for the following:

  m_SSH.SshHostname = m_sHost
  m_SSH.SshPort = m_iPort
  m_SSH.SshLogin = m_sLogin
  m_SSH.SshPassword = m_sPassword

Would anyone have an example for Xojo?

Thanks, Johnny Harris

asked Jun 11 at 13:44

jharris's gravatar image

jharris
11

edited Jun 11 at 13:45


This code seems to work:

Function Connect() As Boolean
  mErrorMsg = ""
  ssh.DestHostname = SshHost
  ssh.DestPort = RemotePort
  if ssh.Connect(SshHost, SshPort) then
    if ssh.AuthenticatePw(Username, Password) then
      if ssh.BeginAccepting( LocalPort ) then
        Return true
      else
        mErrorMsg = ssh.LastErrorText
        Return False
      end
    else
      mErrorMsg = ssh.LastErrorText
      Return False
    end
  else
    mErrorMsg = ssh.LastErrorText
    Return False
  end

End Function
link

answered Jun 11 at 17:27

jharris's gravatar image

jharris
11

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×23
×8

Asked: Jun 11 at 13:44

Seen: 213 times

Last updated: Jun 11 at 17:27

powered by OSQA