Git Product home page Git Product logo

udptunnel's Introduction

UDP Tunnel

考虑到联机时用udp进行广播搜索房间时,OpenVPN无法转发udp消息,因此做了一个基于kcp的tunnel,用于转发udp消息

使用方法

go build -o udptunnel.exe

然后双击运行生成出来的udptunnel.exe即可

首先,你需要一个有公网ip的机器,在上面运行udptunnel.exe -s

然后建房间的玩家启动udptunnel.exe之后选择服务器,其它玩家选择客户端。之后再在游戏中创建房间,就能正常搜索房间了

举例

我们用“流星蝴蝶剑”联机为例。众所周知,“流星蝴蝶剑”是使用的udp进行联机的,房主监听的是udp端口5230。如下步骤进行即可:

  1. 首先,你需要一个有公网ip的机器,例如XX云服务器,在上面运行udptunnel.exe -s别忘了设置服务器的防火墙,将udp端口12345设置为允许
  2. 房主在自己的电脑上运行udptunnel.exe,选择服务器,然后端口输入5230。之后房主就可以进入游戏建房了。
  3. 其它玩家在自己的电脑上运行udptunnel.exe,选择客户端,然后选择房主的服务器。之后进行游戏,搜索房间列表,就能搜到房间了。

说明:

  1. 很有可能,你的XX云服务器是linux机器,而自己的电脑是windows机器,那么你需要编译出两个系统版本的udptunnel。
  2. 如果不想监听12345端口,可以运行udptunnel.exe -s -p 12345自行指定端口,那么所有人连接时也要同样输入udptunnel.exe -p 12345

udptunnel's People

Contributors

cutereimu avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

sabixr

udptunnel's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.