Skip to content
This repository was archived by the owner on Mar 14, 2026. It is now read-only.

Commit 46f4abe

Browse files
authored
Port handler-proxy (http-only) (#71)
Port handler-proxy (http-only)
1 parent 3500b1e commit 46f4abe

16 files changed

Lines changed: 2618 additions & 0 deletions

DotNetty.sln

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "local-build", "local-build"
9292
localRestore.cmd = localRestore.cmd
9393
EndProjectSection
9494
EndProject
95+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetty.Handlers.Proxy", "src\DotNetty.Handlers.Proxy\DotNetty.Handlers.Proxy.csproj", "{9A960CAF-E1BB-49F0-8F4F-7FA52F787CFC}"
96+
EndProject
97+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetty.Handlers.Proxy.Tests", "test\DotNetty.Handlers.Proxy.Tests\DotNetty.Handlers.Proxy.Tests.csproj", "{8A11F53C-02FD-4537-9BC9-0525489F128B}"
98+
EndProject
9599
Global
96100
GlobalSection(SolutionConfigurationPlatforms) = preSolution
97101
Debug|Any CPU = Debug|Any CPU
@@ -520,6 +524,38 @@ Global
520524
{920F73C7-7FBE-44BE-8A99-3A394207D4C8}.Release|x64.Build.0 = Release|Any CPU
521525
{920F73C7-7FBE-44BE-8A99-3A394207D4C8}.Release|x86.ActiveCfg = Release|Any CPU
522526
{920F73C7-7FBE-44BE-8A99-3A394207D4C8}.Release|x86.Build.0 = Release|Any CPU
527+
{9A960CAF-E1BB-49F0-8F4F-7FA52F787CFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
528+
{9A960CAF-E1BB-49F0-8F4F-7FA52F787CFC}.Debug|Any CPU.Build.0 = Debug|Any CPU
529+
{9A960CAF-E1BB-49F0-8F4F-7FA52F787CFC}.Debug|ARM.ActiveCfg = Debug|Any CPU
530+
{9A960CAF-E1BB-49F0-8F4F-7FA52F787CFC}.Debug|ARM.Build.0 = Debug|Any CPU
531+
{9A960CAF-E1BB-49F0-8F4F-7FA52F787CFC}.Debug|x64.ActiveCfg = Debug|Any CPU
532+
{9A960CAF-E1BB-49F0-8F4F-7FA52F787CFC}.Debug|x64.Build.0 = Debug|Any CPU
533+
{9A960CAF-E1BB-49F0-8F4F-7FA52F787CFC}.Debug|x86.ActiveCfg = Debug|Any CPU
534+
{9A960CAF-E1BB-49F0-8F4F-7FA52F787CFC}.Debug|x86.Build.0 = Debug|Any CPU
535+
{9A960CAF-E1BB-49F0-8F4F-7FA52F787CFC}.Release|Any CPU.ActiveCfg = Release|Any CPU
536+
{9A960CAF-E1BB-49F0-8F4F-7FA52F787CFC}.Release|Any CPU.Build.0 = Release|Any CPU
537+
{9A960CAF-E1BB-49F0-8F4F-7FA52F787CFC}.Release|ARM.ActiveCfg = Release|Any CPU
538+
{9A960CAF-E1BB-49F0-8F4F-7FA52F787CFC}.Release|ARM.Build.0 = Release|Any CPU
539+
{9A960CAF-E1BB-49F0-8F4F-7FA52F787CFC}.Release|x64.ActiveCfg = Release|Any CPU
540+
{9A960CAF-E1BB-49F0-8F4F-7FA52F787CFC}.Release|x64.Build.0 = Release|Any CPU
541+
{9A960CAF-E1BB-49F0-8F4F-7FA52F787CFC}.Release|x86.ActiveCfg = Release|Any CPU
542+
{9A960CAF-E1BB-49F0-8F4F-7FA52F787CFC}.Release|x86.Build.0 = Release|Any CPU
543+
{8A11F53C-02FD-4537-9BC9-0525489F128B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
544+
{8A11F53C-02FD-4537-9BC9-0525489F128B}.Debug|Any CPU.Build.0 = Debug|Any CPU
545+
{8A11F53C-02FD-4537-9BC9-0525489F128B}.Debug|ARM.ActiveCfg = Debug|Any CPU
546+
{8A11F53C-02FD-4537-9BC9-0525489F128B}.Debug|ARM.Build.0 = Debug|Any CPU
547+
{8A11F53C-02FD-4537-9BC9-0525489F128B}.Debug|x64.ActiveCfg = Debug|Any CPU
548+
{8A11F53C-02FD-4537-9BC9-0525489F128B}.Debug|x64.Build.0 = Debug|Any CPU
549+
{8A11F53C-02FD-4537-9BC9-0525489F128B}.Debug|x86.ActiveCfg = Debug|Any CPU
550+
{8A11F53C-02FD-4537-9BC9-0525489F128B}.Debug|x86.Build.0 = Debug|Any CPU
551+
{8A11F53C-02FD-4537-9BC9-0525489F128B}.Release|Any CPU.ActiveCfg = Release|Any CPU
552+
{8A11F53C-02FD-4537-9BC9-0525489F128B}.Release|Any CPU.Build.0 = Release|Any CPU
553+
{8A11F53C-02FD-4537-9BC9-0525489F128B}.Release|ARM.ActiveCfg = Release|Any CPU
554+
{8A11F53C-02FD-4537-9BC9-0525489F128B}.Release|ARM.Build.0 = Release|Any CPU
555+
{8A11F53C-02FD-4537-9BC9-0525489F128B}.Release|x64.ActiveCfg = Release|Any CPU
556+
{8A11F53C-02FD-4537-9BC9-0525489F128B}.Release|x64.Build.0 = Release|Any CPU
557+
{8A11F53C-02FD-4537-9BC9-0525489F128B}.Release|x86.ActiveCfg = Release|Any CPU
558+
{8A11F53C-02FD-4537-9BC9-0525489F128B}.Release|x86.Build.0 = Release|Any CPU
523559
EndGlobalSection
524560
GlobalSection(SolutionProperties) = preSolution
525561
HideSolutionNode = FALSE
@@ -553,6 +589,8 @@ Global
553589
{E6B102FE-C706-4C40-B4F9-569EFC89B70F} = {01F3CC7E-F996-411E-AFD6-72673A826549}
554590
{920F73C7-7FBE-44BE-8A99-3A394207D4C8} = {01F3CC7E-F996-411E-AFD6-72673A826549}
555591
{E27C94F8-A148-46D4-A1E0-2CC2B1FBECE9} = {013DFD29-E1DB-4968-A67B-C2342E6F5B6E}
592+
{9A960CAF-E1BB-49F0-8F4F-7FA52F787CFC} = {3D04C4DC-6F8E-4326-9569-92F3E26C6EEB}
593+
{8A11F53C-02FD-4537-9BC9-0525489F128B} = {01F3CC7E-F996-411E-AFD6-72673A826549}
556594
EndGlobalSection
557595
GlobalSection(ExtensibilityGlobals) = postSolution
558596
SolutionGuid = {A659CEFB-DDB3-49BE-AEDD-FF2F1B3297DB}

src/DotNetty.Codecs/Base64/Base64.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ public static class Base64
3939
const sbyte EQUALS_SIGN_ENC = -1; // Indicates equals sign in encoding
4040

4141
public static IByteBuffer Encode(IByteBuffer src) => Encode(src, Base64Dialect.Standard);
42+
43+
public static IByteBuffer Encode(IByteBuffer src, bool breakLines) => Encode(src, breakLines, Base64Dialect.Standard);
4244

4345
public static IByteBuffer Encode(IByteBuffer src, IBase64Dialect dialect) => Encode(src, src.ReaderIndex, src.ReadableBytes, dialect.BreakLinesByDefault, dialect);
4446

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<Import Project="..\nuget.props" />
3+
4+
<PropertyGroup>
5+
<TargetFrameworks>$(StandardTfms)</TargetFrameworks>
6+
<RootNamespace>DotNetty.Handlers.Proxy</RootNamespace>
7+
<AssemblyName>SpanNetty.Handlers.Proxy</AssemblyName>
8+
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
9+
</PropertyGroup>
10+
11+
<PropertyGroup Label="NuGet">
12+
<PackageId>SpanNetty.Handlers.Proxy</PackageId>
13+
<Title>SpanNetty.Handlers.Proxy</Title>
14+
<Description>Protobuf Proto3 codec.</Description>
15+
<PackageTags>socket;tcp;protocol;netty;dotnetty;network;proxy;webproxy;httpproxy;tunnelproxy</PackageTags>
16+
</PropertyGroup>
17+
18+
<ItemGroup>
19+
<ProjectReference Include="..\DotNetty.Codecs.Http\DotNetty.Codecs.Http.csproj" />
20+
<ProjectReference Include="..\DotNetty.Transport\DotNetty.Transport.csproj" />
21+
</ItemGroup>
22+
23+
<Import Project="..\version.props" />
24+
</Project>
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* Copyright 2012 The Netty Project
3+
*
4+
* The Netty Project licenses this file to you under the Apache License,
5+
* version 2.0 (the "License"); you may not use this file except in compliance
6+
* with the License. You may obtain a copy of the License at:
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations
14+
* under the License.
15+
*
16+
* Copyright (c) 2020 The Dotnetty-Span-Fork Project (cuteant@outlook.com) All rights reserved.
17+
*
18+
* https://github.com/cuteant/dotnetty-span-fork
19+
*
20+
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
21+
*/
22+
23+
using DotNetty.Codecs.Http;
24+
25+
namespace DotNetty.Handlers.Proxy
26+
{
27+
/// <summary>
28+
/// Specific case of a connection failure, which may include headers from the proxy.
29+
/// </summary>
30+
public sealed class HttpProxyConnectException : ProxyConnectException
31+
{
32+
/// <summary>
33+
/// @param message The failure message.
34+
/// @param headers Header associated with the connection failure. May be {@code null}.
35+
/// </summary>
36+
public HttpProxyConnectException(string message, HttpHeaders headers)
37+
: base(message)
38+
{
39+
this.Headers = headers;
40+
}
41+
42+
/// <summary>
43+
/// Returns headers, if any. May be {@code null}.
44+
/// </summary>
45+
public HttpHeaders Headers { get; }
46+
}
47+
}

0 commit comments

Comments
 (0)