From 0188ffd19f5ec8791747370c41f770a87f855395 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Thu, 17 Dec 2020 14:25:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dzlm=E5=9C=A8=20docker?= =?UTF-8?q?=E6=97=B6=E4=BB=A3=E7=90=86=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/vmp/media/zlm/ZLMHTTPProxyController.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHTTPProxyController.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHTTPProxyController.java index 4b2cabd4..f76cdd90 100644 --- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHTTPProxyController.java +++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHTTPProxyController.java @@ -1,10 +1,12 @@ package com.genersoft.iot.vmp.media.zlm; import com.alibaba.fastjson.JSONObject; +import com.genersoft.iot.vmp.conf.MediaServerConfig; import com.genersoft.iot.vmp.storager.IVideoManagerStorager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpRequest; import org.springframework.http.HttpStatus; @@ -27,6 +29,8 @@ public class ZLMHTTPProxyController { @Autowired private IVideoManagerStorager storager; + @Value("${media.port}") + private int mediaHttpPort; @ResponseBody @RequestMapping(value = "/**/**/**", produces = "application/json;charset=UTF-8") @@ -35,11 +39,12 @@ public class ZLMHTTPProxyController { if (storager.getMediaInfo() == null) { return "未接入流媒体"; } + MediaServerConfig mediaInfo = storager.getMediaInfo(); String requestURI = String.format("http://%s:%s%s?%s&%s", - storager.getMediaInfo().getLocalIP(), - storager.getMediaInfo().getHttpPort(), + mediaInfo.getLocalIP(), + mediaHttpPort, request.getRequestURI().replace("/zlm",""), - storager.getMediaInfo().getHookAdminParams(), + mediaInfo.getHookAdminParams(), request.getQueryString() ); // 发送请求