Comments (6)
I try to use the following code, which is not very effective
conn, err := net.Dial("udp", "140.143.226.61:3478")
if err != nil {
panic(err)
}
go func() {
for {
buf := make([]byte, 1024)
n, err := conn.Read(buf)
if err != nil {
panic(err)
}
fmt.Println(buf[0:n])
}
}()
c, err := stun.NewClient(conn)
from stun.
You can use UDP and this found transport address to send data to your UDP server behind the NAT.
from stun.
Hi, you should use a de-multiplexer on your UDP "connection".
The low-level example of NAT Traversal can be found at cmd/stun-traversal
I will add more high-level example (with de-multiplexer) soon.
from stun.
I've created an example, please see cmd/stun-multiplex
from stun.
I've created an example, please see cmd/stun-multiplex
Ok, I have read it, thank you for your reply.
from stun.
Note that it will work only for non-symmetric NAT.
Closing for now.
from stun.
Related Issues (20)
- client: support TCP protocol
- Refactor stun.Client for hole punching HOT 1
- all: RFC 8489 HOT 1
- errors: allocate only if -debug flag set HOT 1
- e2e: use long-term credentials
- all: add IPv6 support
- client: alternate server tips HOT 1
- all: implement RFC 5780 NAT Discovery HOT 4
- e2e: mount coturn config instead of building image
- client: fix possible data race in handleAgentCallback
- all: add stun-bench cmd
- all: switch to modules HOT 1
- all: implement URI parsing by RFC 7064
- e2e: capture packets
- UDP Question + Proxy Protocol HOT 3
- how set username and credential HOT 2
- return both ipv4 and ipv6 address HOT 4
- What's the relationship with pion/stun HOT 2
- can not get LocalAddr in stun package HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stun.