Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add connecting to custom port #30

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mhbahmani
Copy link

No description provided.

@mhbahmani mhbahmani closed this Jan 20, 2022
@mhbahmani
Copy link
Author

Closes #29

@mhbahmani mhbahmani reopened this Jan 20, 2022
@melbahja
Copy link
Owner

Can you use net.SplitHostPort ? and make the default port 22

@mhbahmani
Copy link
Author

Now check it out please.

@SegFault42
Copy link

Possible to merge it please ?

@melbahja
Copy link
Owner

This will break v1, it's gonna be in v2

Alternately if you want to connect to a custom port u can do:

user := "user"
addr := "127.0.0.1"
port := 22
// auth := your auth 

callback, err := goph.DefaultKnownHosts()
if err != nil {
   // handle err
}

client, err := goph.NewConn(&goph.Config{
  User:     user,
  Addr:     addr,
  Port:     port,
  Auth:     auth,
  Timeout:  goph.DefaultTimeout,
  Callback: callback,
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants