mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-04 18:09:12 +03:00
[PR #3992] [CLOSED] WIP: Networking backend change. (Testing) #9809
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/jellyfin/jellyfin/pull/3992
Author: @BaronGreenback
Created: 8/26/2020
Status: ❌ Closed
Base:
master← Head:Networking2📝 Commits (10+)
2b88729Merge pull request #52 from jellyfin/master80a5c4dMake MediaBrowser.MediaEncoding warnings freed5deb6dFix build804fe98Reduce warnings in Emby.Dlna30e5d95Code review4ca5121Fix all warnings in Emby.Dlna8c68f40Simplify FFmpeg detection code4dbc283Add unsupported ffmpeg version to testsb240007bump DotNet.Glob66edca7Fix dlna play to📊 Changes
135 files changed (+15582 additions, -1785 deletions)
View changed files
📝
Emby.Dlna/Configuration/DlnaOptions.cs(+36 -8)📝
Emby.Dlna/ConnectionManager/ConnectionManagerService.cs(+1 -1)📝
Emby.Dlna/ConnectionManager/ConnectionManagerXmlBuilder.cs(+79 -78)📝
Emby.Dlna/ConnectionManager/ServiceActionListBuilder.cs(+5 -5)📝
Emby.Dlna/ContentDirectory/ContentDirectoryService.cs(+2 -2)📝
Emby.Dlna/ContentDirectory/ContentDirectoryXmlBuilder.cs(+114 -113)📝
Emby.Dlna/ContentDirectory/ControlHandler.cs(+86 -86)📝
Emby.Dlna/ContentDirectory/ServiceActionListBuilder.cs(+5 -5)📝
Emby.Dlna/Didl/DidlBuilder.cs(+6 -6)📝
Emby.Dlna/DlnaManager.cs(+3 -1)📝
Emby.Dlna/Emby.Dlna.csproj(+3 -3)📝
Emby.Dlna/Main/DlnaEntryPoint.cs(+349 -281)📝
Emby.Dlna/MediaReceiverRegistrar/MediaReceiverRegistrarService.cs(+1 -1)📝
Emby.Dlna/MediaReceiverRegistrar/MediaReceiverRegistrarXmlBuilder.cs(+53 -54)📝
Emby.Dlna/MediaReceiverRegistrar/ServiceActionListBuilder.cs(+5 -5)➕
Emby.Dlna/Net/EventArgs/RequestReceivedEventArgs.cs(+65 -0)➕
Emby.Dlna/Net/EventArgs/ResponseReceivedEventArgs.cs(+51 -0)➕
Emby.Dlna/Net/Parsers/HttpParserBase.cs(+249 -0)➕
Emby.Dlna/Net/Parsers/HttpRequestParser.cs(+84 -0)➕
Emby.Dlna/Net/Parsers/HttpResponseParser.cs(+73 -0)...and 80 more files
📄 Description
Redesigned NetworkManager class.
Implemented the ability to exclude IP addresses by enclosing them in [ ]. These exclusions are built into all network options.
Can be used to exclude virtual interfaces. IP addresses can be FQDN. Interfaces can be specified by either using :- eth or the interface description("TP-LINK Wireless USB Adapter”)
Fully documented and Logger output.
Event driven, so lists auto update after network changes, or user intervention.
LAN addresses auto populated with private connected subnets if left blank.
New system parameter "TrustIP6Interfaces" determines if IP6 interface are treated as internal or external (see https://github.com/jellyfin/jellyfin/pull/3515.)
Caching implemented on network objects, and interfaces.
New classes (IPHost, IPNetAddress, and NetCollection) take care of anything IP based (Parsing, comparing, IP & Subnets, subnets comparisons, etc) and are fully LINQ compatible.
IPv6 compatible code providing IPv6 functionality.
Implements DNS lookup (auto-refreshed cache) meaning code can be simplified elsewhere.
Test unit provided.
Added a new configuration option EnableIPv6
Implemented and extended my previous change.
PublishedServerUrl implemented which overrides binding options for services.
Added a custom PublishedServerUrl per subnet, allowing users to specify what the response should be by source.
Adding interface binding options (with intelligent interface selection if nothing is specified) for services.
Add port range restriction capability for HDHomerun.
Improved socket handling when interface becomes unavailable. (SocketFactory)
Improved network change handing (DlnaEntryPoint.cs).
Removed unused async and task function definitions as advised by the compiler.
Traffic is no longer sent out of excluded interfaces (Platform dependant.)
Received traffic from excluded IP addresses/networks is ignored.
Implemented IPv6 SSDP & UDP capability. (except Homerun as i thought this change was already too big)
New Mono.NAT uPNP implementation and gateway monitoring.
SSDP and Mono.NAT now co-exist peacefully and work with each other.
Added UDP port range capability for HRHomerun.
Config Settings:
(Value in brackets is the default setting.)
LocalNetworkSubnets (empty) : Defines local subnets, and is used by the DLNA subsystem.
If blank, all the subnets of any private interfaces will be assumed to be the LAN.
Interface names, descriptions and subnets can be specified, as well as exclusions (addresses enclosed with [], or beginning with !)
usage:
10.0.0.0/8,!192.168.1.1 means 10.0.0.0/8 is in the LAN, but ignore traffic to/from 192.168.1.1
!eth1 means every interface but exclude the interface eth1.
LocalNetworkAddresses (empty) : lists the interfaces that jellyfin binds to. Default is all interfaces.
Interface names, descriptions and subnets can be specified, as well as exclusions (addresses starting with !)
usage:
10.10.10.10 means listen only on 10.10.10.10
!eth1 means listen on every interface except eth1.
Advanced settings: (direct xml edit required)
HDHomerunPortRange (Random Port) : Specify a UDP port, or range of UDP ports that HDHomerun uses.
GatewayMonitorPeriod (60 seconds) : How often the gateway is pinged to ensure it's operational.
EnableIPV6 (False) : Disable/enable IPv6 usage. (Not implemented on HDHomerun)
TrustAllIP6Interfaces (false) ; All IPv6 interfaces are deemed to be local. (See conversation at #3515.)
EnableMultiSocketBinding (true) : System will use specific ip bound sockets. Autocalculated, but can be overridden.
PublishedServerUriBySubnet (empty) : list of [subnets|interfaces]/[serverUri|host|ip] [port] values that replicate the --published-server-url command line argument, but on a per subnet basis, enabling.
usage:
UPnPCreateHttpPortMap (false): Maps the HTTP port in addition to the HTTPS port on any network devices detected via uPNP (if active). Historically, uPnP has mapped both the HTTP and HTTP ports inbound. This is now no longer the case.
The following mimics the --published-server-url option but only for external requests.
The following causes any requests from the subnet defined by eth1 to respond with a hostname jellyfin.com
The following causes any requests from the subnet defined by eth1 to respond with a hostname jellyfin.com, and everything else to return the address http://jellyexternal.com
The following changes the url address dependant upon source request.
Logging
To enable debug logging, edit logging.default.json, and add
Retired settings
BlastAliveMessages - see comment below.
IgnoreVirtualInterfaces - no longer valid (pre 10.6). Exclude virtual interface by including them in LocalNetworkSubnets settings (and LocalNetworkAddresses if no interface defined ) enclosed in [ ]. eg. [eth1] will exclude interface 1, from being used.
SendOnlyMatchedHost (false)- No longer valid. It causes SSDP replies to be sent to all subnets, not just the local ones.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.