Git Product home page Git Product logo

gohop's Issues

Uncle to connect Handshake timeout, retry

Handshake timeout, retry

my server config file

[default]
# server or client
mode = server

[server]
# port range to listen
hopstart = 40100
hopend = 40200
# server addr
#addr = 10.1.1.1/24
addr=74.208.181.199/32
# master key
#mtu = 1400
mtu = 1400
key = mykey
# method of traffic morphing: none or randsize
morphmethod = randsize
# Fix MSS for tcp handshake
fixmss = true
peertimeout = 60
up = some.sh
down = some.sh

my client config file

[default]
# server or client
mode = client

[client]
# gohop server
server = 74.208.181.199
# port range for hopping
#hopstart = 4000
hopstart=40100
hopend=40200
#hopend = 5000
#mtu = 1400
mtu = 1400
key = mykey
# method of traffic morphing: none or randsize
morphmethod = randsize
# whether to redirect flow through gohop
redirect-gateway = true
# is server and client in the same subnet?
local = false
heartbeat-interval = 30
up = chnroute-up.sh
down = chnroute-down.sh

so whats wrong?

can not run on mac os?

get gohop

$ go get github.com/bigeagle/gohop
package code.google.com/p/gcfg: Get https://code.google.com/p/gcfg/source/checkout?repo=: dial tcp 216.58.199.110:443: i/o timeout

fix:

diff --git a/hop/config.go b/hop/config.go
index 88eceb0..c5e0e50 100644
--- a/hop/config.go
+++ b/hop/config.go
@@ -3,7 +3,7 @@ package hop
 import (
        "errors"

-       "code.google.com/p/gcfg"
+       "gopkg.in/gcfg.v1"
 )

 // Server Config

re-run go get

$ go get github.com/bigeagle/gohop

# github.com/bigeagle/water
../water/if.go:22: undefined: createInterface
../water/if.go:22: undefined: cIFF_TAP
../water/if.go:22: undefined: cIFF_NO_PI
../water/if.go:38: undefined: createInterface
../water/if.go:38: undefined: cIFF_TUN
../water/if.go:38: undefined: cIFF_NO_PI

Can't build progect from source.

May be I use wrong golang version? Which is golang version acceptable?

andrey@andrey-Extensa-5220:~/sandbox/gohop-0.0.2$ go get github.com/bigeagle/go-logging
andrey@andrey-Extensa-5220:~/sandbox/gohop-0.0.2$ go get github.com/bigeagle/water
andrey@andrey-Extensa-5220:~/sandbox/gohop-0.0.2$ go get code.google.com/p/gcfg
andrey@andrey-Extensa-5220:~/sandbox/gohop-0.0.2$ go get github.com/bigeagle/gohop
# github.com/bigeagle/gohop/hop
/usr/lib/go/src/pkg/github.com/bigeagle/gohop/hop/buffer.go:58: hb.timer.Reset undefined (type *time.Timer has no field or method Reset)
/usr/lib/go/src/pkg/github.com/bigeagle/gohop/hop/buffer.go:68: hb.timer.Reset undefined (type *time.Timer has no field or method Reset)
/usr/lib/go/src/pkg/github.com/bigeagle/gohop/hop/client.go:212: method clt.handleHandshakeAck is not an expression, must be called
/usr/lib/go/src/pkg/github.com/bigeagle/gohop/hop/client.go:213: method clt.handleHandshakeError is not an expression, must be called
/usr/lib/go/src/pkg/github.com/bigeagle/gohop/hop/client.go:214: method clt.handleDataPacket is not an expression, must be called
/usr/lib/go/src/pkg/github.com/bigeagle/gohop/hop/client.go:215: method clt.handleDataPacket is not an expression, must be called
/usr/lib/go/src/pkg/github.com/bigeagle/gohop/hop/client.go:216: method clt.handleFinishAck is not an expression, must be called
/usr/lib/go/src/pkg/github.com/bigeagle/gohop/hop/iface.go:116: undefined: bufio.NewScanner
/usr/lib/go/src/pkg/github.com/bigeagle/gohop/hop/iface.go:117: undefined: bufio.ScanWords
/usr/lib/go/src/pkg/github.com/bigeagle/gohop/hop/server.go:216: method srv.handleKnock is not an expression, must be called
/usr/lib/go/src/pkg/github.com/bigeagle/gohop/hop/server.go:216: too many errors
andrey@andrey-Extensa-5220:~/sandbox/gohop-0.0.2$ go install github.com/bigeagle/gohop
# github.com/bigeagle/gohop/hop
/usr/lib/go/src/pkg/github.com/bigeagle/gohop/hop/buffer.go:58: hb.timer.Reset undefined (type *time.Timer has no field or method Reset)
/usr/lib/go/src/pkg/github.com/bigeagle/gohop/hop/buffer.go:68: hb.timer.Reset undefined (type *time.Timer has no field or method Reset)
/usr/lib/go/src/pkg/github.com/bigeagle/gohop/hop/client.go:212: method clt.handleHandshakeAck is not an expression, must be called
/usr/lib/go/src/pkg/github.com/bigeagle/gohop/hop/client.go:213: method clt.handleHandshakeError is not an expression, must be called
/usr/lib/go/src/pkg/github.com/bigeagle/gohop/hop/client.go:214: method clt.handleDataPacket is not an expression, must be called
/usr/lib/go/src/pkg/github.com/bigeagle/gohop/hop/client.go:215: method clt.handleDataPacket is not an expression, must be called
/usr/lib/go/src/pkg/github.com/bigeagle/gohop/hop/client.go:216: method clt.handleFinishAck is not an expression, must be called
/usr/lib/go/src/pkg/github.com/bigeagle/gohop/hop/iface.go:116: undefined: bufio.NewScanner
/usr/lib/go/src/pkg/github.com/bigeagle/gohop/hop/iface.go:117: undefined: bufio.ScanWords
/usr/lib/go/src/pkg/github.com/bigeagle/gohop/hop/server.go:216: method srv.handleKnock is not an expression, must be called
/usr/lib/go/src/pkg/github.com/bigeagle/gohop/hop/server.go:216: too many errors

About systemd and aur.

Does this wonderful program support systemd?
And would you mind my submitting it to ArchLinux User Repository?

建议贴

大佬有空可以看看 Shadowrocket,因为我现在用的是M1,可以直接安装ios app,所以同理使用 Shadowrocket 可以直接代理转vpn

after running "go get github.com/bigeagle/gohop",encounter error

hi.
root@VM:/go# go get github.com/bigeagle/gohop
package github.com/golang/snappy/snappy: cannot find package "github.com/golang/snappy/snappy" in any of:
/root/go/src/github.com/golang/snappy/snappy (from $GOROOT)
/root/go/src/github.com/golang/snappy/snappy (from $GOPATH)
root@VM:
/go#

how to fix it?tks

Add Auth Module

Hello, I hope are well. You can add an authentication module? Thank you.
Sorry for my bad English.

client route table question

fedora route table:
10.8.8.4 * 255.255.255.255 UH 0 0 0 tun0
10.8.8.0 10.8.8.4 255.255.255.0 UG 0 0 0 tun0
default 10.8.8.4 128.0.0.0 UG 0 0 0 tun0
default 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
128.0.0.0 10.8.8.4 128.0.0.0 UG 0 0 0 tun0
为什么有两个 "default"?,是否由这句引起:ip -4 route add 0.0.0.0/1 via 10.8.8.4 dev tun0
128.0.0.0这条是什么意思

Friendly suggestion

Hello.

I don't know if your intention is to do a program or a library/package. In the first case I suggest you to keep everything in one directory (deleting the hop package and implementing all as main). I think that the objective of this project is to help users to evade censorship, most of whom aren't familiarized with Golang (or Linux environments or similar). The best would be to do a simple program that compiles with the following commands: git clone https://github.com/bigeagle/gohop; cd gohop; go get; go build without the usage of go get and go install installing or GOPATH env, since the go ecosystem isn't too friendly to endusers.

too many errors on Debian

~# go get github.com/bigeagle/gohop

github.com/bigeagle/gohop/hop

/usr/lib/go/src/pkg/github.com/bigeagle/gohop/hop/buffer.go:58: hb.timer.Reset undefined (type *time.Timer has no field or method Reset)
/usr/lib/go/src/pkg/github.com/bigeagle/gohop/hop/buffer.go:68: hb.timer.Reset undefined (type *time.Timer has no field or method Reset)
/usr/lib/go/src/pkg/github.com/bigeagle/gohop/hop/client.go:212: method clt.handleHandshakeAck is not an expression, must be called
/usr/lib/go/src/pkg/github.com/bigeagle/gohop/hop/client.go:213: method clt.handleHandshakeError is not an expression, must be called
/usr/lib/go/src/pkg/github.com/bigeagle/gohop/hop/client.go:214: method clt.handleDataPacket is not an expression, must be called
/usr/lib/go/src/pkg/github.com/bigeagle/gohop/hop/client.go:215: method clt.handleDataPacket is not an expression, must be called
/usr/lib/go/src/pkg/github.com/bigeagle/gohop/hop/client.go:216: method clt.handleFinishAck is not an expression, must be called
/usr/lib/go/src/pkg/github.com/bigeagle/gohop/hop/iface.go:116: undefined: bufio.NewScanner
/usr/lib/go/src/pkg/github.com/bigeagle/gohop/hop/iface.go:117: undefined: bufio.ScanWords
/usr/lib/go/src/pkg/github.com/bigeagle/gohop/hop/server.go:216: method srv.handleKnock is not an expression, must be called
/usr/lib/go/src/pkg/github.com/bigeagle/gohop/hop/server.go:216: too many errors

tunnel instead of full-featured VPN?

Isn't more easy/universal way just to implement some obfuscation tunnel so you can just re-use OpenVPN etc over it? Something like tor's obfsproxy?

This also mean you doesn't need VPN part so doesn't need tun/tap. So you can tunnel exisiting Windows/Mac OpenVPN via yours tunnel :)

Unable to handshake with the server

I wanted to connect from my minnowboard running Ubuntu18.04 to my VPS deployed in HK with gohop. But the handshaking could not be done after both server and client have been correctly configured according to the manual. After diagnosing with several potential causes, i finally found that the ports in the range specified in the server.ini are listened by the server only for udp6 addresses as my ISP does not really support ipv6 addressing. Even if I disabled the ipv6 on the server side, the ports are still listened only for udp6. This may be the cause of the problem. Here is the netstat output:
udp6 0 0 [::]:40100 [::]:* udp6 0 0 [::]:40101 [::]:* udp6 0 0 [::]:40102 [::]:* udp6 0 0 [::]:40103 [::]:* udp6 0 0 [::]:40104 [::]:* udp6 0 0 [::]:40105 [::]:* udp6 0 0 [::]:40106 [::]:* udp6 0 0 [::]:40107 [::]:* udp6 0 0 [::]:40108 [::]:* udp6 0 0 [::]:40109 [::]:* udp6 0 0 [::]:40110 [::]:* udp6 0 0 [::]:40111 [::]:* udp6 0 0 [::]:40112 [::]:* udp6 0 0 [::]:40113 [::]:* udp6 0 0 [::]:40114 [::]:* udp6 0 0 [::]:40115 [::]:* udp6 0 0 [::]:40116 [::]:* udp6 0 0 [::]:40117 [::]:* udp6 0 0 [::]:40118 [::]:* udp6 0 0 [::]:40119 [::]:* udp6 0 0 [::]:40120 [::]:* udp6 0 0 [::]:40121 [::]:* udp6 0 0 [::]:40122 [::]:* udp6 0 0 [::]:40123 [::]:* udp6 0 0 [::]:40124 [::]:* udp6 0 0 [::]:40125 [::]:* udp6 0 0 [::]:40126 [::]:* udp6 0 0 [::]:40127 [::]:* udp6 0 0 [::]:40128 [::]:* udp6 0 0 [::]:40129 [::]:* udp6 0 0 [::]:40130 [::]:* udp6 0 0 [::]:40131 [::]:* udp6 0 0 [::]:40132 [::]:* udp6 0 0 [::]:40133 [::]:* udp6 0 0 [::]:40134 [::]:* udp6 0 0 [::]:40135 [::]:* udp6 0 0 [::]:40136 [::]:* udp6 0 0 [::]:40137 [::]:* udp6 0 0 [::]:40138 [::]:* udp6 0 0 [::]:40139 [::]:* udp6 0 0 [::]:40140 [::]:* udp6 0 0 [::]:40141 [::]:* udp6 0 0 [::]:40142 [::]:* udp6 0 0 [::]:40143 [::]:* udp6 0 0 [::]:40144 [::]:* udp6 0 0 [::]:40145 [::]:* udp6 0 0 [::]:40146 [::]:* udp6 0 0 [::]:40147 [::]:* udp6 0 0 [::]:40148 [::]:* udp6 0 0 [::]:40149 [::]:* udp6 0 0 [::]:40150 [::]:* udp6 0 0 [::]:40151 [::]:* udp6 0 0 [::]:40152 [::]:* udp6 0 0 [::]:40153 [::]:* udp6 0 0 [::]:40154 [::]:* udp6 0 0 [::]:40155 [::]:* udp6 0 0 [::]:40156 [::]:* udp6 0 0 [::]:40157 [::]:* udp6 0 0 [::]:40158 [::]:* udp6 0 0 [::]:40159 [::]:* udp6 0 0 [::]:40160 [::]:* udp6 0 0 [::]:40161 [::]:* udp6 0 0 [::]:40162 [::]:* udp6 0 0 [::]:40163 [::]:* udp6 0 0 [::]:40164 [::]:* udp6 0 0 [::]:40165 [::]:* udp6 0 0 [::]:40166 [::]:* udp6 0 0 [::]:40167 [::]:* udp6 0 0 [::]:40168 [::]:* udp6 0 0 [::]:40169 [::]:* udp6 0 0 [::]:40170 [::]:* udp6 0 0 [::]:40171 [::]:* udp6 0 0 [::]:40172 [::]:* udp6 0 0 [::]:40173 [::]:* udp6 0 0 [::]:40174 [::]:* udp6 0 0 [::]:40175 [::]:* udp6 0 0 [::]:40176 [::]:* udp6 0 0 [::]:40177 [::]:* udp6 0 0 [::]:40178 [::]:* udp6 0 0 [::]:40179 [::]:* udp6 0 0 [::]:40180 [::]:* udp6 0 0 [::]:40181 [::]:* udp6 0 0 [::]:40182 [::]:* udp6 0 0 [::]:40183 [::]:* udp6 0 0 [::]:40184 [::]:* udp6 0 0 [::]:40185 [::]:* udp6 0 0 [::]:40186 [::]:* udp6 0 0 [::]:40187 [::]:* udp6 0 0 [::]:40188 [::]:* udp6 0 0 [::]:40189 [::]:* udp6 0 0 [::]:40190 [::]:* udp6 0 0 [::]:40191 [::]:* udp6 0 0 [::]:40192 [::]:* udp6 0 0 [::]:40193 [::]:* udp6 0 0 [::]:40194 [::]:* udp6 0 0 [::]:40195 [::]:* udp6 0 0 [::]:40196 [::]:* udp6 0 0 [::]:40197 [::]:* udp6 0 0 [::]:40198 [::]:* udp6 0 0 [::]:40199 [::]:* udp6 0 0 [::]:40200 [::]:*

"tap interface not implemented on this platform"

I get:

./gohop server.ini 
[16-07-29 05:04:04][INFO] using config file: %v server.ini
[16-07-29 05:04:04][ERROR] tap interface not implemented on this platform

on MacOS but I see:

commit e68425556224a9d474b02790b21a4eeaa956ac6c
Author: ox0spy <[email protected]>
Date:   Fri Feb 12 10:32:32 2016 -0800

    run gohop on Mac OS.

so I think this can run on this platform now right?

connection is successful - how to use on Ubuntu 19.04

I installed the server on a remote machine ... here is server launch

root@forelsket /my/gopath/src/github.com/bigeagle/gohop # gohop -debug -config   server.ini
[19-06-11 13:52:04][INFO] using config file: %v server.ini
[19-06-11 13:52:04][DEBUG] %v {40100 40200  10.1.1.1/24 1400 mykeyhere true randsize 60 some.sh some.sh}
[19-06-11 13:52:04][DEBUG] {40100 40200  10.1.1.1/24 1400 mykeyhere true randsize 60 some.sh some.sh}
Deprecated: NewTUN(..) may be removed in the future. Please use New() instead.
[19-06-11 13:52:04][INFO] interface %v created tun0
[19-06-11 13:52:04][INFO] ip %s link set dev tun0 up mtu 1400 qlen 100
[19-06-11 13:52:04][DEBUG] %v 10.1.1.1
[19-06-11 13:52:04][INFO] ip %s addr add dev tun0 local 10.1.1.1 peer 10.1.1.2
[19-06-11 13:52:04][INFO] ip %s route add 10.1.1.0/24 via 10.1.1.2 dev tun0
[19-06-11 13:52:04][INFO] Fix MSS with iptables to %d 1360
[19-06-11 13:52:04][INFO] iptables %s -I FORWARD -i tun0 -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --set-mss 1360
[19-06-11 13:52:04][WARNIN] Traffic Morphing is disabled in this version
[19-06-11 13:52:04][INFO] some.sh
[19-06-11 13:52:04][DEBUG] Recieving iface frames
[19-06-11 13:52:04][INFO] some.sh
[19-06-11 13:52:04][WARNIN] client peer with key 625762201 not found
[19-06-11 13:52:07][DEBUG] New UDP Packet [128] from : 88.88.88.88:54694
[19-06-11 13:52:07][DEBUG] port knock from client 88.88.88.88:54694, sid: 783650831
[19-06-11 13:52:07][DEBUG] New UDP Packet [128] from : 88.88.88.88:42383
[19-06-11 13:52:07][DEBUG] port knock from client 88.88.88.88:42383, sid: 783650831
[19-06-11 13:52:07][DEBUG] New UDP Packet [128] from : 88.88.88.88:42453
[19-06-11 13:52:07][DEBUG] port knock from client 88.88.88.88:42453, sid: 783650831
[19-06-11 13:52:07][DEBUG] New UDP Packet [128] from : 88.88.88.88:60527
[19-06-11 13:52:07][DEBUG] port knock from client 88.88.88.88:60527, sid: 783650831
[19-06-11 13:52:07][DEBUG] New UDP Packet [128] from : 88.88.88.88:38603
[19-06-11 13:52:07][DEBUG] port knock from client 88.88.88.88:38603, sid: 783650831
[19-06-11 13:52:07][DEBUG] New UDP Packet [128] from : 88.88.88.88:59222
[19-06-11 13:52:07][DEBUG] port knock from client 88.88.88.88:59222, sid: 783650831
[19-06-11 13:52:07][DEBUG] New UDP Packet [128] from : 88.88.88.88:59890
[19-06-11 13:52:07][DEBUG] port knock from client 88.88.88.88:59890, sid: 783650831
[19-06-11 13:52:07][DEBUG] New UDP Packet [128] from : 88.88.88.88:56186
[19-06-11 13:52:07][DEBUG] port knock from client 88.88.88.88:56186, sid: 783650831
[19-06-11 13:52:07][DEBUG] New UDP Packet [128] from : 88.88.88.88:42841
[19-06-11 13:52:07][DEBUG] port knock from client 88.88.88.88:42841, sid: 783650831
[19-06-11 13:52:07][DEBUG] New UDP Packet [64] from : 88.88.88.88:54694
[19-06-11 13:52:07][DEBUG] handshake from client 88.88.88.88:54694, sid: 3365754690628222976
[19-06-11 13:52:07][DEBUG] assign address 10.1.1.3/24, route key 167837955
[19-06-11 13:52:07][DEBUG] peer: 88.88.88.88:59222
[19-06-11 13:52:07][DEBUG] New UDP Packet [128] from : 88.88.88.88:40169
[19-06-11 13:52:07][DEBUG] port knock from client 88.88.88.88:40169, sid: 783650831
[19-06-11 13:52:07][DEBUG] New UDP Packet [68] from : 88.88.88.88:59222
[19-06-11 13:52:07][DEBUG] Client Handshake Done
[19-06-11 13:52:07][INFO] Client 3365754690628222976 Connected
[19-06-11 13:52:07][DEBUG] New UDP Packet [0] from : 88.88.88.88:35532
[19-06-11 13:52:07][DEBUG] New UDP Packet [0] from : 88.88.88.88:46309
[19-06-11 13:52:07][DEBUG] New UDP Packet [0] from : 88.88.88.88:35658
[19-06-11 13:52:07][DEBUG] New UDP Packet [0] from : 88.88.88.88:44829
[19-06-11 13:52:07][DEBUG] New UDP Packet [0] from : 88.88.88.88:41347

here is my client launch

root@peach /my/gopath/src/github.com/bigeagle/gohop # gohop   -config    client.ini
[19-06-11 14:06:49][INFO] using config file: %v client.ini
[19-06-11 14:06:49][WARNIN] Traffic Morphing is disabled in this version
Deprecated: NewTUN(..) may be removed in the future. Please use New() instead.
[19-06-11 14:06:49][INFO] interface %v created tun0
[19-06-11 14:06:49][INFO] ip %s link set dev tun0 up mtu 1400 qlen 100
[19-06-11 14:06:49][INFO] ip -4 r a 111.222.333.20/32 via 10.176.32.1 dev wlp2s0
[19-06-11 14:06:49][INFO] start handeshaking
[19-06-11 14:06:49][INFO] ip %s addr add dev tun0 local 10.1.1.3 peer 10.1.1.4
[19-06-11 14:06:49][INFO] ip %s route add 10.1.1.0/24 via 10.1.1.4 dev tun0
[19-06-11 14:06:49][INFO] Session Initialized
[19-06-11 14:06:49][INFO] Handshake Success
[19-06-11 14:06:49][INFO] chnroute-up.sh
[19-06-11 14:06:49][INFO] Redirecting Gateway
[19-06-11 14:06:49][INFO] ip %s -4 route add 0.0.0.0/1 via 10.1.1.4 dev tun0
[19-06-11 14:06:49][INFO] ip %s -4 route add 128.0.0.0/1 via 10.1.1.4 dev tun0


[19-06-11 14:07:40][INFO] Cleaning Up
[19-06-11 14:07:40][INFO] ip %s -4 route del 0.0.0.0/1
[19-06-11 14:07:40][INFO] ip %s -4 route del 128.0.0.0/1
[19-06-11 14:07:40][INFO] chnroute-down.sh
[19-06-11 14:07:40][INFO] Finishing Session
[19-06-11 14:07:40][INFO] Finish Acknowledged
[19-06-11 14:07:40][INFO] ip %s -4 route del 111.222.333.20/32

so I have a successful connection from client to server ... question is How do I use this connection ? I am on a Ubuntu 19.04 desktop ... using other vpn approaches once a successful connection is made applications like my browser just automatically start using the vpn connection however once above connection is made my browser just times out

Sequence of events ... I ssh onto my remove machine and launch your server from a terminal ... then I launch my client in another terminal ... once a good connection is made I can see ongoing logging shown in server terminal window so I still have connectivity to that remote machine via ssh ... Problem is any browser I use just times out ... from a new terminal things like ping fail to connect ... evidently the vpn connection my client has made is not being made available to my applications

"go get github.com/bigeagle/water" on win7x64

go version
go version go1.2 windows/amd64
set GOPATH=D:\Go\src
go get github.com/bigeagle/water

github.com/bigeagle/water

D:\Go\src\src\github.com\bigeagle\water\if.go:22: undefined: createInterface
D:\Go\src\src\github.com\bigeagle\water\if.go:22: undefined: cIFF_TAP
D:\Go\src\src\github.com\bigeagle\water\if.go:22: undefined: cIFF_NO_PI
D:\Go\src\src\github.com\bigeagle\water\if.go:38: undefined: createInterface
D:\Go\src\src\github.com\bigeagle\water\if.go:38: undefined: cIFF_TUN
D:\Go\src\src\github.com\bigeagle\water\if.go:38: undefined: cIFF_NO_PI

Releases not happening

This looks really useful, and I would like to work on this.
Why no releases for over a year though ?

Fix the logging output

Fix the logging output!

gohop -debug -config server.ini
[16-10-02 02:41:54][INFO] using config file: %v server.ini
[16-10-02 02:41:54][DEBUG] %v {4000 4000  192.168.5.50/24 1400 ilovethebigbrother true none 60  }
[16-10-02 02:41:54][DEBUG] %v {4000 4000  192.168.5.50/24 1400 ilovethebigbrother true none 60  }
[16-10-02 02:41:54][INFO] interface %v created tun0
[16-10-02 02:41:54][INFO] ip %s link set dev tun0 up mtu 1400 qlen 100
[16-10-02 02:41:54][DEBUG] %v 192.168.5.50

ERROR: config.json:1:1: illegal character U+007B '{'

This is my config.json:

{
  "server": "127.0.0.1:8086"
}

When I run this command I get this error:

./gohop --config config.json
2024/04/10 15:03:58 main.go:60: INFO: using config file: config.json
2024/04/10 15:03:58 main.go:51: ERROR: config.json:1:1: illegal character U+007B '{'
2024/04/10 15:03:58 main.go:51: ERROR: config.json:1:1: illegal character U+007B '{'

Implement correct config input validation

Please implement correct config input validation!

Sample: addr = 192.168.5.50

gohop -debug -config server.ini
[16-10-02 02:44:41][INFO] using config file: %v server.ini
[16-10-02 02:44:41][DEBUG] %v {4000 4000  192.168.5.50 1400 ilovethebigbrother true none 60  }
[16-10-02 02:44:41][DEBUG] %v {4000 4000  192.168.5.50 1400 ilovethebigbrother true none 60  }
[16-10-02 02:44:41][INFO] interface %v created tun0
[16-10-02 02:44:41][INFO] ip %s link set dev tun0 up mtu 1400 qlen 100
[16-10-02 02:44:41][DEBUG] %v <nil>
panic: runtime error: index out of range

goroutine 1 [running]:
panic(0x5ac6c0, 0xc4200120e0)
    /usr/lib/go/src/runtime/panic.go:500 +0x1a1
github.com/bigeagle/gohop/hop.setTunIP(0xc420015b60, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6a8920)
    /go/src/github.com/bigeagle/gohop/hop/iface.go:64 +0x97a
github.com/bigeagle/gohop/hop.NewServer(0xfa0, 0xfa0, 0x0, 0x0, 0xc420013640, 0xc, 0x578, 0xc420011120, 0x12, 0x1, ...)
    /go/src/github.com/bigeagle/gohop/hop/server.go:105 +0x52f
main.main()
    /go/src/github.com/bigeagle/gohop/main.go:75 +0x696

Bad performance over LFN

I'm running gohop across a long fat pipe and I'm getting bad performance. Usually when I rsync a file on one side from the other side I can reach up to 600 KB/s, but using gohop I can only reach 60 KB/s. I don't think gohop itself is using TCP so there would be no flow control problem. And RTT with and without gohop are approximately the same (~400ms). Both machines have a pretty light CPU load and memory usage. I guess there is a huge packet loss somewhere but I don't know how to diagnose. Do you have any suggestion where I should start digging into this issue?

Some questions about source code

After reading the source code of gohop, i have 2 questions about the implementation that i don't understand, could u explain it?

  1. What does the 'rate' mean in hopPacketBuffer:Pop(), to delay the pop operation? What does the algorithm means?

    func (hb *hopPacketBuffer) Pop() *HopPacket {
    <-hb.newPack
    r := int(hb.rate & 0x10)
    if hb.buf.count < 8+r {
        time.Sleep(time.Duration(r*20+50) * time.Microsecond)
        hb.rate = hb.rate >> 1
    }
    p := hb.buf.Pop().(*HopPacket)
    return p
    }
    
  2. For the PKCS5UnPadding method, if there's no padding, this method will still get the last byte as padding length, is it wrong ?

    func PKCS5UnPadding(origData []byte) []byte {
    length := len(origData)
    unpadding := int(origData[length-1])
    return origData[:(length - unpadding)]
    }
    
  3. If one of the port between [HopStart, HopEnd] is blocked, the client knowns nothing about that, and still trying to forward packets to the port blocked (because of handshake succed on another port), without retrying and port switching ?

client not reachable from outside

gohop establish vpn connection between Server and client ,They both can ping each other with Public ip and private IP but from other network client cannot ping .HOw can i solve this and next issue is if connection from Server is lost Client cannot regain internet back again ,so we must restart physically ,sir can u give me solution how can i achieve both

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.