shawwwn / gole Goto Github PK
View Code? Open in Web Editor NEWA p2p hole punching/tunneling tool written in Go.
License: BSD 2-Clause "Simplified" License
A p2p hole punching/tunneling tool written in Go.
License: BSD 2-Clause "Simplified" License
is it possible to add support for multiple port fowarding, or forwarding port ranges?
Lines 240 to 278 in 5115deb
The code snippet seems replaceable with io.copy directly.
// Copy copies from src to dst until either EOF is reached
// on src or an error occurs. It returns the number of bytes
// copied and the first error encountered while copying, if any.
//
// A successful Copy returns err == nil, not err == EOF.
// Because Copy is defined to read from src until EOF, it does
// not treat an EOF from Read as an error to be reported.
//
// If src implements the WriterTo interface,
// the copy is implemented by calling src.WriteTo(dst).
// Otherwise, if dst implements the ReaderFrom interface,
// the copy is implemented by calling dst.ReadFrom(src).
func Copy(dst Writer, src Reader) (written int64, err error) {
return copyBuffer(dst, src, nil)
}
Write like:
func Forward(local *net.TCPConn, remote *net.TCPConn) {
f := func(src *net.TCPConn, dst *net.TCPConn) {
defer src.Close()
defer dst.Close()
_, err := io.Copy(src, dst)
if err != nil {
log.errorf("Fail to copy from src to dst, err=%v", err)
return
}
}
go f(local, remote)
go f(remote, local)
}
not really an issue but i am wondering how does gole work without an external server? I thought you absolutely need a server which can actually forward ports and is globally accessible.
is it what server option is for? lets say i am trying to play a p2p game and both players need to know each other's ip and both are behind NAT and cannot forward ports.
how would i do that?
Hello..
first of all. thank you for this amazing project.
however, I have a question/problem?
what if we don't know the "client" public ip address? is there a way to use the tunnel for the sole purpose of port forwarding between point A and point B? so Point A has a static configuration and point B only needs to know point A's public ip and port?
Can this work with openvpn?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.