mirror of
https://github.com/wanghongenpin/proxypin.git
synced 2026-03-29 06:59:46 +08:00
content-type video
This commit is contained in:
@@ -309,11 +309,12 @@ class ChannelPipeline extends ChannelHandler<Uint8List> {
|
||||
Channel? remoteChannel = channelContext.getAttribute(channel.id);
|
||||
|
||||
//大body 不解析直接转发
|
||||
if (buffer.length > Codec.maxBodyLength) {
|
||||
relay(channel, remoteChannel!);
|
||||
handler.channelRead(channelContext, channel, buffer.bytes);
|
||||
buffer.clear();
|
||||
if (buffer.length > Codec.maxBodyLength && handler is! RelayHandler) {
|
||||
logger.w("[$channel] forward large body");
|
||||
relay(channel, remoteChannel!);
|
||||
var body = buffer.bytes;
|
||||
buffer.clear();
|
||||
handler.channelRead(channelContext, channel, body);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ abstract class HttpMessage {
|
||||
"application/x-www-form-urlencoded": ContentType.formUrl,
|
||||
"form-data": ContentType.formData,
|
||||
"image": ContentType.image,
|
||||
"video": ContentType.video,
|
||||
"application/json": ContentType.json
|
||||
};
|
||||
|
||||
@@ -195,6 +196,7 @@ enum ContentType {
|
||||
css,
|
||||
font,
|
||||
image,
|
||||
video,
|
||||
http;
|
||||
|
||||
static ContentType valueOf(String name) {
|
||||
@@ -203,7 +205,7 @@ enum ContentType {
|
||||
|
||||
//是否是二进制
|
||||
bool get isBinary {
|
||||
return this == image || this == font;
|
||||
return this == image || this == font || this == video;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ const contentMap = {
|
||||
ContentType.html: Icons.html,
|
||||
ContentType.js: Icons.javascript,
|
||||
ContentType.image: Icons.image,
|
||||
ContentType.video: Icons.video_call,
|
||||
ContentType.text: Icons.text_fields,
|
||||
ContentType.css: Icons.css,
|
||||
ContentType.font: Icons.font_download,
|
||||
|
||||
@@ -358,6 +358,9 @@ class _BodyState extends State<_Body> {
|
||||
if (type == ViewType.image) {
|
||||
return Image.memory(Uint8List.fromList(message?.body ?? []), fit: BoxFit.none);
|
||||
}
|
||||
if (type == ViewType.video) {
|
||||
return const Center(child: Text("video not support preview"));
|
||||
}
|
||||
if (type == ViewType.hex) {
|
||||
return SelectableText(message!.body!.map(intToHex).join(" "), contextMenuBuilder: contextMenu);
|
||||
}
|
||||
@@ -379,6 +382,11 @@ class Tabs {
|
||||
return tabs;
|
||||
}
|
||||
|
||||
if (contentType == ContentType.video) {
|
||||
tabs.list.add(ViewType.hex);
|
||||
return tabs;
|
||||
}
|
||||
|
||||
if (contentType == ContentType.json) {
|
||||
tabs.list.add(ViewType.jsonText);
|
||||
}
|
||||
@@ -411,6 +419,7 @@ enum ViewType {
|
||||
jsonText("JSON Text"),
|
||||
html("HTML"),
|
||||
image("Image"),
|
||||
video("Video"),
|
||||
css("CSS"),
|
||||
js("JavaScript"),
|
||||
hex("Hex"),
|
||||
|
||||
@@ -47,9 +47,6 @@ class _LeftNavigationBarState extends State<LeftNavigationBar> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
widget.controller.addListener(() {
|
||||
print('page: ${widget.controller.page}');
|
||||
});
|
||||
|
||||
return ValueListenableBuilder(
|
||||
valueListenable: widget.selectIndex,
|
||||
|
||||
Reference in New Issue
Block a user