diff --git a/README.md b/README.md index 60a567c88..4843ca939 100755 --- a/README.md +++ b/README.md @@ -151,7 +151,7 @@ Supported operating systems and hardware: 1. Support listen at multiple ports. 1. Support long time(>4.6hours) publish/play. 1. High performace, 1800 connections(500kbps), 900Mbps, CPU 90.2%, 41MB -1. Support forward publish stream to build active-standby [cluster](https://github.com/winlinvip/simple-rtmp-server/wiki/Cluster). +1. Support forward publish stream to build active-standby [Forward](https://github.com/winlinvip/simple-rtmp-server/wiki/Forward). 1. Support broadcast by forward the stream to other servers(origin/edge). 1. Support live stream transcoding by ffmpeg. 1. Support live stream forward(acopy/vcopy) by ffmpeg. @@ -199,7 +199,7 @@ Supported operating systems and hardware: * 2013-12-25, [Release v0.9](https://github.com/winlinvip/simple-rtmp-server/releases/tag/0.9), support bandwidth test, player/encoder/chat [demos](https://github.com/winlinvip/simple-rtmp-server/wiki/SampleDemo). 20926 lines.
* 2013-12-08, [Release v0.8](https://github.com/winlinvip/simple-rtmp-server/releases/tag/0.8), support [http hooks callback](https://github.com/winlinvip/simple-rtmp-server/wiki/HTTPCallback), update [st_load](https://github.com/winlinvip/st-load). 19186 lines.
* 2013-12-03, [Release v0.7](https://github.com/winlinvip/simple-rtmp-server/releases/tag/0.7), support [live stream transcoding](https://github.com/winlinvip/simple-rtmp-server/wiki/FFMPEG). 17605 lines.
-* 2013-11-29, [Release v0.6](https://github.com/winlinvip/simple-rtmp-server/releases/tag/0.6), support [forward](https://github.com/winlinvip/simple-rtmp-server/wiki/Cluster) stream to origin/edge. 16094 lines.
+* 2013-11-29, [Release v0.6](https://github.com/winlinvip/simple-rtmp-server/releases/tag/0.6), support [forward](https://github.com/winlinvip/simple-rtmp-server/wiki/Forward) stream to origin/edge. 16094 lines.
* 2013-11-26, [Release v0.5](https://github.com/winlinvip/simple-rtmp-server/releases/tag/0.5), support [HLS(m3u8)](https://github.com/winlinvip/simple-rtmp-server/wiki/DeliveryHLS), fragment and window. 14449 lines.
* 2013-11-10, [Release v0.4](https://github.com/winlinvip/simple-rtmp-server/releases/tag/0.4), support [reload](https://github.com/winlinvip/simple-rtmp-server/wiki/Reload) config, pause, longtime publish/play. 12500 lines.
* 2013-11-04, [Release v0.3](https://github.com/winlinvip/simple-rtmp-server/releases/tag/0.3), support [vhost](https://github.com/winlinvip/simple-rtmp-server/wiki/RtmpUrlVhost), refer, gop cache, listen multiple ports. 11773 lines.
@@ -310,7 +310,7 @@ Supported operating systems and hardware: * v1.0, 2014-01-19, add wiki [DeliveryHLS](https://github.com/winlinvip/simple-rtmp-server/wiki/DeliveryHLS) * v1.0, 2014-01-12, add wiki [HowToAskQuestion](https://github.com/winlinvip/simple-rtmp-server/wiki/HowToAskQuestion), [RtmpUrlVhost](https://github.com/winlinvip/simple-rtmp-server/wiki/RtmpUrlVhost) * v1.0, 2014-01-11, fix jw/flower player pause bug, which send closeStream actually. -* v1.0, 2014-01-05, add wiki [Build](https://github.com/winlinvip/simple-rtmp-server/wiki/Build), [Performance](https://github.com/winlinvip/simple-rtmp-server/wiki/Performance), [Cluster](https://github.com/winlinvip/simple-rtmp-server/wiki/Cluster) +* v1.0, 2014-01-05, add wiki [Build](https://github.com/winlinvip/simple-rtmp-server/wiki/Build), [Performance](https://github.com/winlinvip/simple-rtmp-server/wiki/Performance), [Forward](https://github.com/winlinvip/simple-rtmp-server/wiki/Forward) * v1.0, 2014-01-01, change listen(512), chunk-size(60000), to improve performance. * v1.0, 2013-12-27, merge from wenjie, the bandwidth test feature. * v0.9, 2013-12-25, [v0.9](https://github.com/winlinvip/simple-rtmp-server/releases/tag/0.9) released. 20926 lines. @@ -507,8 +507,8 @@ to ingest any input to rtmp, push to SRS. ### [RTMP cluster(origin/edge) Architecture](https://github.com/winlinvip/simple-rtmp-server/wiki/Edge) -Remark: cluster over forward, see [Cluster](https://github.com/winlinvip/simple-rtmp-server/wiki/Cluster) Remark: cluster over edge, see [Edge](https://github.com/winlinvip/simple-rtmp-server/wiki/Edge) +Remark: cluster over forward, see [Forward](https://github.com/winlinvip/simple-rtmp-server/wiki/Forward)
 +---------+       +-----------------+     +-----------------------+ 
diff --git a/trunk/src/app/srs_app_utility.cpp b/trunk/src/app/srs_app_utility.cpp
index 5fc03cfaf..27e3db41c 100644
--- a/trunk/src/app/srs_app_utility.cpp
+++ b/trunk/src/app/srs_app_utility.cpp
@@ -993,6 +993,25 @@ string srs_get_local_ip(int fd)
     return ip;
 }
 
+int srs_get_local_port(int fd)
+{
+    std::string ip;
+
+    // discovery client information
+    sockaddr_in addr;
+    socklen_t addrlen = sizeof(addr);
+    if (getsockname(fd, (sockaddr*)&addr, &addrlen) == -1) {
+        return 0;
+    }
+    srs_verbose("get local ip success.");
+    
+    int port = ntohs(addr.sin_port);
+
+    srs_verbose("get local ip of client port=%s, fd=%d", port, fd);
+
+    return port;
+}
+
 string srs_get_peer_ip(int fd)
 {
     std::string ip;
diff --git a/trunk/src/app/srs_app_utility.hpp b/trunk/src/app/srs_app_utility.hpp
index 85ec1fae8..891f54d55 100644
--- a/trunk/src/app/srs_app_utility.hpp
+++ b/trunk/src/app/srs_app_utility.hpp
@@ -619,12 +619,14 @@ extern std::vector& srs_get_local_ipv4_ips();
 
 // get local or peer ip.
 // where local ip is the server ip which client connected.
-std::string srs_get_local_ip(int fd);
+extern std::string srs_get_local_ip(int fd);
+// get the local id port.
+extern int srs_get_local_port(int fd);
 // where peer ip is the client public ip which connected to server.
-std::string srs_get_peer_ip(int fd);
+extern std::string srs_get_peer_ip(int fd);
 
 // dump summaries for /api/v1/summaries.
-void srs_api_dump_summaries(std::stringstream& ss);
+extern void srs_api_dump_summaries(std::stringstream& ss);
 
 #endif