I2P Address: [http://git.idk.i2p]

Verified Commit 6eca8863 authored by idk's avatar idk
Browse files

add error message that describes how to fix the SAM AUTH issue if you restart...

add error message that describes how to fix the SAM AUTH issue if you restart the password before removing the USER and setting AUTH DISABLE
parent 40ad754b
......@@ -2,6 +2,7 @@ package main
import (
"fmt"
"log"
"github.com/eyedeekay/goSam"
)
......@@ -14,17 +15,30 @@ fails for some reason before you can remove them.
**/
func main() {
client, err := goSam.NewDefaultClient()
client, err := goSam.NewClientFromOptions()
if err != nil {
client, err = goSam.NewClientFromOptions(
goSam.SetUser("user"),
goSam.SetPass("password"),
)
fmt.Println("Looks like you restarted the I2P router before sending AUTH DISABLE.")
fmt.Println("This probably means that your SAM Bridge is in a broken state where it can't")
fmt.Println("accept HELLO or AUTH commands anymore. You should fix this by removing the")
fmt.Println("sam.auth=true entry from sam.config.")
err = client.TeardownAuth()
if err != nil {
fmt.Println(err)
}
fmt.Println(err)
panic(err)
}
err = client.SetupAuth("user", "password")
if err != nil {
panic(err)
log.Println(err)
}
client2, err := goSam.NewDefaultClient()
if err != nil {
panic(err)
log.Println(err)
}
conn, err := client2.Dial("", "idk.i2p")
if err != nil {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment