Total Pageviews

Saturday 6 August 2016

tcm端口映射器

TCMPortMapper is an Obj-C/Cocoa NAT-Traversal framework that maps ports via UPNP and NAT-PMP.
TCMPortMapper.framework uses libnatpmp and miniupnpc to provide an easy to use Cocoa interface to automatically map ports to your networked application via UPNP and NAT-PMP.
Included is a sample application to map ports and a short illustration (an echo server) of using the framework within your own code.
This shows the BasicUsage .
For a more complete featureset: the public header.
The framework supports 10.4 and greater.
Here is a ListOfAppsUsingTCMPortMapper - if you use it in your app, please enter the app.

If you are into Windows development you might want to look at the .net port of this library at http://code.google.com/p/dotnetportmapper/ 
from  https://code.google.com/archive/p/tcmportmapper/
-----------

tcp端口映射器

动机
由于网络上下载的一个貌似delphi写的PortMap v1.6( http://www.onlinedown.net/soft/7023.htm )版本的工具频率崩溃, 于是花了一些时间重写了一个用于做端口映射的工具程序, 虽然简单, 但却实用, 本来想再添加一个支持sock5代理, web远程管理, 以及GUI和日志功能, 和各链接数据收发统计日志, 但是由于个人时间有限, 所以希望有兴趣的朋友能参与来完善等其它额外功能.
编译说明:
依赖boost, 编译器为vc2005或以上或gcc, 目前运行平台支持windows和linux. 在windows上直接使用vc2005或以上版本打开portmap.sln即可编译. 在linux平台可使用boost的bjam进行编译.
编译参数:
LOGGER_OUTPUT_LOG  表示打开日志输出功能.
LOGGER_DEBUG_VIEW  表示打开debugview调试功能, 仅能在win32平台下使用.
LOGGER_THREAD_SAFE 表示日志输出使用线程安全.
若使用bjam进行编译, 则需要设置环境变量
BOOST_ROOT=BOOST的ROOT目录(即boost的源码包解压出来的目录)
BOOST_BUILD_PATH=$(BOOST_ROOT)/tools/build/v2
然后执行
bjam
bjam define=LOGGER_OUTPUT_LOG
即可编译.
配置文件
运行配置参数需要修改文件conf.cfg, 如:
server port=8080
remote host=127.0.0.1:80
注: 在release下有已经编译好的exe, 可以直接测试使用。

from https://github.com/Jackarain/portmap

注意:boost的编译可参见