<p>I'm writing a VPN for fun and was hoping to do NAT in Go without relying on the OS. I'm testing this with a simple SYN-ACK ping tool:</p>
<p><a href="https://github.com/jpillora/synack/blob/master/main.go">https://github.com/jpillora/synack/blob/master/main.go</a></p>
<p>This works under linux. On mac/darwin, it successfully sends but never receives anything.</p>
<p>Any ideas?</p>
<hr/>**评论:**<br/><br/>Jamo008: <pre><p>Not looking good :( <a href="https://stackoverflow.com/a/29083319/977939">https://stackoverflow.com/a/29083319/977939</a></p>
<blockquote>
<p>The problem with this is that OS X is based on BSD, and BSD doesn't allow you to program raw sockets at the TCP level. You have to use go down to the Ethernet level in order to do so.</p>
<p>I'm using the pcap library with gopackets to do the job.</p>
<p><a href="https://godoc.org/code.google.com/p/gopacket/pcap">https://godoc.org/code.google.com/p/gopacket/pcap</a></p>
</blockquote></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传