You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: Please read FAQ before file an issue, see 2716
Note: Before asking a question, please refer to the FAQ, specifically 2716.
Description (描述)
srs5.0 HTTP callback exception: When the HTTP callback response returns code 200 and response = 0, it still reports an error, causing the streaming to disconnect.
# SRS Reference Configuration
listen 1935;
max_connections 1000;
# srs_log_tank file;
# srs_log_file ./objs/srs.log;
daemon off;
http_api {
enabled on;
listen 1985;
}
http_server {
enabled on;
listen 8080;
dir ./objs/nginx/html;
# Enable HTTPS support, and open port 8088
# https {
# enabled on;
# listen 8088;
# key ./conf/woniu.key;
# cert ./conf/woniu.crt;
# }
}
rtc_server {
enabled on;
listen 8000; # UDP port
# @see https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#config-candidate
candidate $CANDIDATE;
}
vhost __defaultVhost__ {
tcp_nodelay on;
min_latency on;
play {
gop_cache on;
queue_length 0;
mw_latency 0;
mw_msgs 1;
}
publish {
mr off;
}
# HTTP-FLV settings
http_remux{
enabled on;
mount [vhost]/[app]/[stream].flv;
hstrs on;
}
# HLS settings
hls {
enabled on;
hls_fragment 1;
hls_window 2;
hls_path ./objs/nginx/html;
hls_m3u8_file [app]/[stream].m3u8;
hls_ts_file [app]/[stream]-[seq].ts;
}
# DVR settings
dvr {
enabled off;
dvr_path ./objs/nginx/html/[app]/[stream]/[2006]/[01]/[02]/[timestamp].flv;
dvr_plan segment;
dvr_duration 30;
dvr_wait_keyframe on;
}
# RTC settings
rtc {
enabled on;
rtmp_to_rtc on;
keep_bframe discard;
rtc_to_rtmp on;
}
# SRS supports referer anti-leeching: check where the user is coming from. For example, people who are not coming from the company's website are not allowed to view.
refer {
# whether enable the refer hotlink-denial.
# default: off.
enabled off;
# the common refer for play and publish.
# if the page url of client not in the refer, access denied.
# if not specified this field, allow all.
# default: not specified.
all github.com github.io;
# refer for publish clients specified.
# the common refer is not overrided by this.
# if not specified this field, allow all.
# default: not specified.
publish github.com github.io;
# refer for play clients specified.
# the common refer is not overrided by this.
# if not specified this field, allow all.
# default: not specified.
play github.com github.io;
}
# HTTP callback
http_hooks {
# Event: When this event occurs, the specified HTTP address will be called back.
# HTTP address: Multiple addresses are supported, separated by spaces. SRS will sequentially call these interfaces.
# Data: SRS will POST data to the HTTP interface.
# Return value: SRS requires the HTTP server to return HTTP 200 and the response content to be an integer error code (0 indicates success). Other error codes will disconnect the client connection.
# whether the http hooks enable.
# default off.
enabled on;
# When the client connects to the specified vhost and app.
#on_connect http://127.0.0.1:8085/api/v1/clients http://localhost:8085/api/v1/clients;
# When the client closes the connection, or when SRS actively closes the connection.
#on_close http://127.0.0.1:8085/api/v1/clients http://localhost:8085/api/v1/clients;
# When the client publishes a stream, for example, pushing the stream to the server using flash/FMLE.
on_publish http://192.168.1.104:8090/api/srs/on/push/callback;
# When the client stops publishing the stream.
on_unpublish http://192.168.1.104:8090/api/srs/un/push/callback;
# When the client starts playing the stream.
#on_play http://127.0.0.1:8085/api/v1/sessions http://localhost:8085/api/v1/sessions;
# When the client stops playing. Note: Stopping playback may not close the connection and can still continue playing.
#on_stop http://127.0.0.1:8085/api/v1/sessions http://localhost:8085/api/v1/sessions;
# When the DVR recording closes an flv file.
#on_dvr http://127.0.0.1:8085/api/v1/dvrs http://localhost:8085/api/v1/dvrs;
# When HLS generates a ts file.
#on_hls http://127.0.0.1:8085/api/v1/hls http://localhost:8085/api/v1/hls;
# when srs reap a ts file of hls, call this hook,
#on_hls_notify http://127.0.0.1:8085/api/v1/hls/[app]/[stream]/[ts_url][param];
}
}
Replay (重现)
Please describe how to replay the bug? (重现Bug的步骤)
Use docker to build the Dockerfile with the following content.
FROM ossrs/srs:dev AS build
# Install depends tools.
#RUN yum install -y gcc make gcc-c++ patch unzip perl git
# Build and install SRS.
COPY . /srs
WORKDIR /srs/trunk
RUN ./configure --srt=on --jobs=2 && make -j2 && make install
# All config files for SRS.
RUN cp -R conf /usr/local/srs/conf && \
cp research/api-server/static-dir/index.html /usr/local/srs/objs/nginx/html/ && \
cp research/api-server/static-dir/favicon.ico /usr/local/srs/objs/nginx/html/ && \
cp research/players/crossdomain.xml /usr/local/srs/objs/nginx/html/ && \
cp -R research/console /usr/local/srs/objs/nginx/html/ && \
cp -R research/players /usr/local/srs/objs/nginx/html/ && \
cp -R 3rdparty/signaling/www/demos /usr/local/srs/objs/nginx/html/
############################################################
# dist
############################################################
FROM centos:7 AS dist
# Expose ports for streaming @see https://github.com/ossrs/srs#ports
EXPOSE 1935 1985 8080 8000/udp 10080/udp
# FFMPEG 4.1
COPY --from=build /usr/local/bin/ffmpeg /usr/local/srs/objs/ffmpeg/bin/ffmpeg
# SRS binary, config files and srs-console.
COPY --from=build /usr/local/srs /usr/local/srs
# Default workdir and command.
WORKDIR /usr/local/srs
CMD ["./objs/srs", "-c", "conf/docker.conf"]
Open the http_hooks feature to reproduce it.
Expect (Expected Behavior)
Please describe your expectation:
http_hooks should work properly.
I don't know why the value of SRS_HTTP_RESPONSE_OK is 'E'.
TRANS_BY_GPT3
The text was updated successfully, but these errors were encountered:
Description (描述)
SRS Version:
XCORE-SRS/5.0.78(Bee)
linkSRS Log:
Replay (重现)
Expect (Expected Behavior)
I don't know why the value of SRS_HTTP_RESPONSE_OK is 'E'.
TRANS_BY_GPT3
The text was updated successfully, but these errors were encountered: