Debian Codegraph @

examples/vnet-udpproxy/README

raw
1 # vnet-udpproxy
2
3 This example demonstrates how VNet can be used to communicate with non-VNet addresses using UDPProxy.
4
5 In this example we listen map the VNet Address `10.0.0.11` to a real address of our choice. We then
6 send to our real address from three different VNet addresses.
7
8 If you pass `-address 192.168.1.3:8000` the traffic will be the following
9
10 ```
11 vnet(10.0.0.11:5787) => proxy => 192.168.1.3:8000
12 vnet(10.0.0.11:5788) => proxy => 192.168.1.3:8000
13 vnet(10.0.0.11:5789) => proxy => 192.168.1.3:8000
14 ```
15
16 ## Running
17 ```
18 go run main.go -address 192.168.1.3:8000
19 ```
20
21 You should see the following in tcpdump
22 ```
23 sean@SeanLaptop:~/go/src/github.com/pion/transport/examples$ sudo tcpdump -i any udp and port 8000
24 tcpdump: data link type LINUX_SLL2
25 tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
26 listening on any, link-type LINUX_SLL2 (Linux cooked v2), snapshot length 262144 bytes
27 13:21:18.239943 lo In IP 192.168.1.7.40574 > 192.168.1.7.8000: UDP, length 5
28 13:21:18.240105 lo In IP 192.168.1.7.40647 > 192.168.1.7.8000: UDP, length 5
29 13:21:18.240304 lo In IP 192.168.1.7.57744 > 192.168.1.7.8000: UDP, length 5
30 ```