Port forwarding with xinetd Ask
https://stackoverflow.com/questions/21716673/port-forwarding-with-xinetd
------------------------------------------------------------------------------------------------------------------------------------
I want to forward xinetd connection to another local port (say 12345). I based my solution on CentOS/Redhat documentation Chapter 17. TCP Wrappers and xinetd, article 17.4.3.3. In the example the configuration starts a daemon and also redirects the traffic to a host:port. The doco say it should be able to forward to different port on the same system too.
My current goal is to starts a daemon (say testsmpp) at any connection on port 12345 and redirect the stream to a particular port (say 54321). The tricky bit is I don't want the daemon (testsmpp) to read from STDIN, instead it should be able to read from the port where the xinetd is forwarding the traffic to.
I created a service under /etc/service e.g
testsmpp 12345/tcp
And my xinetd configuration for the daemon is
service testsmpp
{
sock_type = stream
protocol = tcp
wait = no
user = root
server = /home/me/bin/testsmpp
redirect = 54321
}
testsmpp listens on port 54321. The problem is when a connection made from outside, xinetd starts the daemon but do not forward the traffic to 54321. Once the server started I can connect directly to 54321 port but the connection made via xinetd (at port 12345) is not forwarded.
Is server and redirect tags are mutually exclusive? I looked at the discussion about xinet forking concurrent server but my motivation are slightly different. I want to listen for incoming connection on another port as the other application will communicate with the daemon on that port too in a distributed computing environment.
Any clues much appreciated.
最新文章
- getComputedStyle的简单用法
- [转]在windows环境中使用varnish
- css学习笔记 6
- Thomas Brinkhoff 基于路网的移动对象生成器的使用
- iOS-----用LLDB调试,让移动开发更简单(二)
- 清空mysql的历史记录
- Amazon Web Services
- JavaWeb学习之Servlet(一)----MyEclipse及Tomcat的配置
- C#DataGridView 美化
- 在线判题 (模拟)http://202.196.1.132/problem.php?id=1164
- oc-08-内存分析
- php redis 消息队列
- Java多线程缓存器简单实现
- Django 使用 locals() 函数
- springMVC整理02--常用注解的使用
- luogu P3767 膜法
- python基础 - 控制语句
- [hive] hive 安装、配置
- js基础学习笔记(六)
- 原生JS一些操作