Issues with raw TCP on darwin

blov · · 511 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I&#39;m writing a VPN for fun and was hoping to do NAT in Go without relying on the OS. I&#39;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&#39;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&#39;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

511 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传