mirror of
				https://github.com/ossrs/srs.git
				synced 2025-03-09 15:49:59 +00:00 
			
		
		
		
	change forward schema
This commit is contained in:
		
							parent
							
								
									bef7e20ed9
								
							
						
					
					
						commit
						8cd1c11add
					
				
					 4 changed files with 43 additions and 15 deletions
				
			
		| 
						 | 
					@ -17,10 +17,10 @@ SRS_FFMPEG=RESERVED
 | 
				
			||||||
SRS_HTTP=RESERVED
 | 
					SRS_HTTP=RESERVED
 | 
				
			||||||
SRS_RESEARCH=RESERVED
 | 
					SRS_RESEARCH=RESERVED
 | 
				
			||||||
SRS_UTEST=RESERVED
 | 
					SRS_UTEST=RESERVED
 | 
				
			||||||
SRS_GPERF=RESERVED
 | 
					SRS_GPERF=RESERVED # tcmalloc
 | 
				
			||||||
SRS_GPERF_MC=RESERVED
 | 
					SRS_GPERF_MC=RESERVED # gperf memory check
 | 
				
			||||||
SRS_GPERF_MP=RESERVED
 | 
					SRS_GPERF_MP=RESERVED # gperf memory profile
 | 
				
			||||||
SRS_GPERF_CP=RESERVED
 | 
					SRS_GPERF_CP=RESERVED # gperf cpu profile
 | 
				
			||||||
# arguments
 | 
					# arguments
 | 
				
			||||||
SRS_JOBS=1
 | 
					SRS_JOBS=1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -31,6 +31,7 @@ SRS_FFMPEG=YES
 | 
				
			||||||
SRS_HTTP=YES
 | 
					SRS_HTTP=YES
 | 
				
			||||||
SRS_RESEARCH=NO
 | 
					SRS_RESEARCH=NO
 | 
				
			||||||
SRS_UTEST=YES
 | 
					SRS_UTEST=YES
 | 
				
			||||||
 | 
					SRS_GPERF=NO
 | 
				
			||||||
SRS_GPERF_MC=NO
 | 
					SRS_GPERF_MC=NO
 | 
				
			||||||
SRS_GPERF_MP=NO
 | 
					SRS_GPERF_MP=NO
 | 
				
			||||||
SRS_GPERF_CP=NO
 | 
					SRS_GPERF_CP=NO
 | 
				
			||||||
| 
						 | 
					@ -61,6 +62,7 @@ do
 | 
				
			||||||
        --with-http)                    SRS_HTTP=YES              ;;
 | 
					        --with-http)                    SRS_HTTP=YES              ;;
 | 
				
			||||||
        --with-research)                SRS_RESEARCH=YES          ;;
 | 
					        --with-research)                SRS_RESEARCH=YES          ;;
 | 
				
			||||||
        --with-utest)                   SRS_UTEST=YES             ;;
 | 
					        --with-utest)                   SRS_UTEST=YES             ;;
 | 
				
			||||||
 | 
					        --with-gperf)                   SRS_GPERF=YES             ;;
 | 
				
			||||||
        --with-gmc)                     SRS_GPERF_MC=YES          ;;
 | 
					        --with-gmc)                     SRS_GPERF_MC=YES          ;;
 | 
				
			||||||
        --with-gmp)                     SRS_GPERF_MP=YES          ;;
 | 
					        --with-gmp)                     SRS_GPERF_MP=YES          ;;
 | 
				
			||||||
        --with-gcp)                     SRS_GPERF_CP=YES          ;;
 | 
					        --with-gcp)                     SRS_GPERF_CP=YES          ;;
 | 
				
			||||||
| 
						 | 
					@ -71,6 +73,7 @@ do
 | 
				
			||||||
        --without-http)                 SRS_HTTP=NO               ;;
 | 
					        --without-http)                 SRS_HTTP=NO               ;;
 | 
				
			||||||
        --without-research)             SRS_RESEARCH=NO           ;;
 | 
					        --without-research)             SRS_RESEARCH=NO           ;;
 | 
				
			||||||
        --without-utest)                SRS_UTEST=NO              ;;
 | 
					        --without-utest)                SRS_UTEST=NO              ;;
 | 
				
			||||||
 | 
					        --without-gperf)                SRS_GPERF=NO              ;;
 | 
				
			||||||
        --without-gmc)                  SRS_GPERF_MC=NO           ;;
 | 
					        --without-gmc)                  SRS_GPERF_MC=NO           ;;
 | 
				
			||||||
        --without-gmp)                  SRS_GPERF_MP=NO           ;;
 | 
					        --without-gmp)                  SRS_GPERF_MP=NO           ;;
 | 
				
			||||||
        --without-gcp)                  SRS_GPERF_CP=NO           ;;
 | 
					        --without-gcp)                  SRS_GPERF_CP=NO           ;;
 | 
				
			||||||
| 
						 | 
					@ -110,6 +113,7 @@ if [ $help = yes ]; then
 | 
				
			||||||
  --with-ffmpeg            enable transcoding with ffmpeg.
 | 
					  --with-ffmpeg            enable transcoding with ffmpeg.
 | 
				
			||||||
  --with-research          build the research tools.
 | 
					  --with-research          build the research tools.
 | 
				
			||||||
  --with-utest             build the utest for srs.
 | 
					  --with-utest             build the utest for srs.
 | 
				
			||||||
 | 
					  --with-gperf             build srs with gperf tools(no gmc/gmp/gcp, with tcmalloc only).
 | 
				
			||||||
  --with-gmc               build memory check for srs with gperf tools.
 | 
					  --with-gmc               build memory check for srs with gperf tools.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  --without-ssl            disable rtmp complex handshake.
 | 
					  --without-ssl            disable rtmp complex handshake.
 | 
				
			||||||
| 
						 | 
					@ -118,6 +122,7 @@ if [ $help = yes ]; then
 | 
				
			||||||
  --without-ffmpeg         disable the ffmpeg transcoding feature.
 | 
					  --without-ffmpeg         disable the ffmpeg transcoding feature.
 | 
				
			||||||
  --without-research       do not build the research tools.
 | 
					  --without-research       do not build the research tools.
 | 
				
			||||||
  --without-utest          do not build the utest for srs.
 | 
					  --without-utest          do not build the utest for srs.
 | 
				
			||||||
 | 
					  --without-gperf          do not build srs with gperf tools(without tcmalloc and gmc/gmp/gcp).
 | 
				
			||||||
  --without-gmc            do not build memory check for srs with gperf tools.
 | 
					  --without-gmc            do not build memory check for srs with gperf tools.
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  --jobs[=N]               Allow N jobs at once; infinite jobs with no arg.
 | 
					  --jobs[=N]               Allow N jobs at once; infinite jobs with no arg.
 | 
				
			||||||
| 
						 | 
					@ -131,6 +136,22 @@ fi
 | 
				
			||||||
# check user options
 | 
					# check user options
 | 
				
			||||||
#####################################################################################
 | 
					#####################################################################################
 | 
				
			||||||
__check_ok=YES
 | 
					__check_ok=YES
 | 
				
			||||||
 | 
					# check conflict
 | 
				
			||||||
 | 
					if [ $SRS_GPERF = NO ]; then
 | 
				
			||||||
 | 
					    if [ $SRS_GPERF_MC = YES ]; then
 | 
				
			||||||
 | 
					        echo "gperf-mc depends on gperf, see: ./configure --help";
 | 
				
			||||||
 | 
					        __check_ok=NO
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					    if [ $SRS_GPERF_MP = YES ]; then
 | 
				
			||||||
 | 
					        echo "gperf-mp depends on gperf, see: ./configure --help";
 | 
				
			||||||
 | 
					        __check_ok=NO
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					    if [ $SRS_GPERF_CP = YES ]; then
 | 
				
			||||||
 | 
					        echo "gperf-cp depends on gperf, see: ./configure --help";
 | 
				
			||||||
 | 
					        __check_ok=NO
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					# check variable neccessary
 | 
				
			||||||
if [ $SRS_SSL = RESERVED ]; then
 | 
					if [ $SRS_SSL = RESERVED ]; then
 | 
				
			||||||
    echo "you must specifies the ssl, see: ./configure --help";
 | 
					    echo "you must specifies the ssl, see: ./configure --help";
 | 
				
			||||||
    __check_ok=NO
 | 
					    __check_ok=NO
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										16
									
								
								trunk/conf/srs.conf
									
										
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										16
									
								
								trunk/conf/srs.conf
									
										
									
									
									
										
										
										Executable file → Normal file
									
								
							| 
						 | 
					@ -535,14 +535,22 @@ vhost same.vhost.forward.vhost.com {
 | 
				
			||||||
    # this used to split/forward the current stream for cluster active-standby,
 | 
					    # this used to split/forward the current stream for cluster active-standby,
 | 
				
			||||||
    # active-active for cdn to build high available fault tolerance system.
 | 
					    # active-active for cdn to build high available fault tolerance system.
 | 
				
			||||||
    # format: {ip}:{port} {ip_N}:{port_N}
 | 
					    # format: {ip}:{port} {ip_N}:{port_N}
 | 
				
			||||||
    # or specify the vhost by:
 | 
					    # or specify the vhost by params, @see: change.vhost.forward.vhost.com
 | 
				
			||||||
    # format: {ip}:{port}?vhost={vhost} {ip_N}:{port_N}?vhost={vhost}
 | 
					 | 
				
			||||||
    # if vhost not specified, use the request vhost instead.
 | 
					    # if vhost not specified, use the request vhost instead.
 | 
				
			||||||
    forward         127.0.0.1:1936 127.0.0.1:1937;
 | 
					    forward         127.0.0.1:1936 127.0.0.1:1937;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
# the vhost which forward publish streams to other vhosts.
 | 
					# TODO: FIXME: change the forward schema with vhost.
 | 
				
			||||||
 | 
					# [plan] the vhost which forward publish streams to other vhosts.
 | 
				
			||||||
vhost change.vhost.forward.vhost.com {
 | 
					vhost change.vhost.forward.vhost.com {
 | 
				
			||||||
    forward         127.0.0.1:1936?vhost=forward2.vhost.com 127.0.0.1:1937?vhost=forward3.vhost.com;
 | 
					    forward         127.0.0.1:1936 127.0.0.1:1937 {
 | 
				
			||||||
 | 
					        # specify the vhost to override the vhost in client request.
 | 
				
			||||||
 | 
					        vhost       forward2.vhost.com;
 | 
				
			||||||
 | 
					        # specify the refer(pageUrl) to override the refer in client request.
 | 
				
			||||||
 | 
					        refer       http://srs/index.html;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    forward         127.0.0.1:1938 {
 | 
				
			||||||
 | 
					        vhost       forward3.vhost.com;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# the vhost disabled.
 | 
					# the vhost disabled.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										8
									
								
								trunk/configure
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								trunk/configure
									
										
									
									
										vendored
									
									
								
							| 
						 | 
					@ -66,6 +66,7 @@ SrsResearchSummaryColor="\$(YELLOW)(disabled) "; if [ $SRS_RESEARCH = YES ]; the
 | 
				
			||||||
SrsUtestSummaryColor="\$(YELLOW)(disabled) "; if [ $SRS_UTEST = YES ]; then SrsUtestSummaryColor="\$(GREEN)"; fi
 | 
					SrsUtestSummaryColor="\$(YELLOW)(disabled) "; if [ $SRS_UTEST = YES ]; then SrsUtestSummaryColor="\$(GREEN)"; fi
 | 
				
			||||||
SrsGperfSummaryColor="\$(YELLOW)(disabled) "; if [ $SRS_GPERF = YES ]; then SrsGperfSummaryColor="\$(GREEN)"; fi
 | 
					SrsGperfSummaryColor="\$(YELLOW)(disabled) "; if [ $SRS_GPERF = YES ]; then SrsGperfSummaryColor="\$(GREEN)"; fi
 | 
				
			||||||
SrsGperfMCSummaryColor="\$(YELLOW)(disabled) "; if [ $SRS_GPERF_MC = YES ]; then SrsGperfMCSummaryColor="\$(GREEN)"; fi
 | 
					SrsGperfMCSummaryColor="\$(YELLOW)(disabled) "; if [ $SRS_GPERF_MC = YES ]; then SrsGperfMCSummaryColor="\$(GREEN)"; fi
 | 
				
			||||||
 | 
					SrsGperfMPSummaryColor="\$(YELLOW)(disabled) "; if [ $SRS_GPERF_MP = YES ]; then SrsGperfMPSummaryColor="\$(GREEN)"; fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#####################################################################################
 | 
					#####################################################################################
 | 
				
			||||||
# makefile
 | 
					# makefile
 | 
				
			||||||
| 
						 | 
					@ -95,8 +96,11 @@ default: bandwidth librtmp-sample utest
 | 
				
			||||||
	@echo -e "     ${SrsUtestSummaryColor}utest: ./objs/srs_utest, the utest for srs\$(BLACK)"
 | 
						@echo -e "     ${SrsUtestSummaryColor}utest: ./objs/srs_utest, the utest for srs\$(BLACK)"
 | 
				
			||||||
	@echo -e "     ${SrsGperfSummaryColor}gperf: gmc/gmp/gcp for srs, @see: \$(BLACK)"
 | 
						@echo -e "     ${SrsGperfSummaryColor}gperf: gmc/gmp/gcp for srs, @see: \$(BLACK)"
 | 
				
			||||||
	@echo -e "          ${SrsGperfMCSummaryColor}gmc: gperf memory check, @see: http://google-perftools.googlecode.com/svn/trunk/doc/heap_checker.html\$(BLACK)"
 | 
						@echo -e "          ${SrsGperfMCSummaryColor}gmc: gperf memory check, @see: http://google-perftools.googlecode.com/svn/trunk/doc/heap_checker.html\$(BLACK)"
 | 
				
			||||||
	@echo -e "          ${SrsGperfMCSummaryColor}env PPROF_PATH=./objs/pprof HEAPCHECK=normal ./objs/srs -c conf/srs.conf # start gmc\$(BLACK)"
 | 
						@echo -e "                  ${SrsGperfMCSummaryColor}env PPROF_PATH=./objs/pprof HEAPCHECK=normal ./objs/srs -c conf/srs.conf # start gmc\$(BLACK)"
 | 
				
			||||||
	@echo -e "          ${SrsGperfMCSummaryColor}killall -2 srs # or CTRL+C to stop gmc\$(BLACK)"
 | 
						@echo -e "                  ${SrsGperfMCSummaryColor}killall -2 srs # or CTRL+C to stop gmc\$(BLACK)"
 | 
				
			||||||
 | 
						@echo -e "          ${SrsGperfMPSummaryColor}gmc: gperf memory profile, @see: http://google-perftools.googlecode.com/svn/trunk/doc/heapprofile.html\$(BLACK)"
 | 
				
			||||||
 | 
						@echo -e "                  ${SrsGperfMPSummaryColor}env PPROF_PATH=./objs/pprof HEAPCHECK=normal ./objs/srs -c conf/srs.conf # start gmc\$(BLACK)"
 | 
				
			||||||
 | 
						@echo -e "                  ${SrsGperfMPSummaryColor}killall -2 srs # or CTRL+C to stop gmc\$(BLACK)"
 | 
				
			||||||
	@echo -e "\$(GREEN)binaries @see: https://github.com/winlinvip/simple-rtmp-server/wiki/Build\$(BLACK)"
 | 
						@echo -e "\$(GREEN)binaries @see: https://github.com/winlinvip/simple-rtmp-server/wiki/Build\$(BLACK)"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
help:
 | 
					help:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -52,12 +52,7 @@ void memory_alloc_profile() {
 | 
				
			||||||
    memory_alloc_profile_imp();
 | 
					    memory_alloc_profile_imp();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void handler(int sig) {
 | 
					 | 
				
			||||||
    exit(0);
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
int main(int argc, char** argv) {
 | 
					int main(int argc, char** argv) {
 | 
				
			||||||
    signal(SIGINT, handler);
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    // must start profiler manually.
 | 
					    // must start profiler manually.
 | 
				
			||||||
    HeapProfilerStart(NULL);
 | 
					    HeapProfilerStart(NULL);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue