GithubHelp home page GithubHelp logo

Comments (11)

Shinetaku avatar Shinetaku commented on July 20, 2024 1

When this issue be published to nuget?

Now remote address is not worked in docker container.

from ftpserver.

fubar-coder avatar fubar-coder commented on July 20, 2024

You can use 0.0.0.0 instead.

from ftpserver.

ArrowCase avatar ArrowCase commented on July 20, 2024

Interesting -- it looks like there is a difference in behavior between two apps I was using for testing, one a .NET Core console application and the other an ASP .NET Core web application (which launches the FTP server in the background). The console application starts up fine with a 0.0.0.0 binding, but the web app throws the following:

crit: FubarDev.FtpServer.FtpServer[0]
      IPv4 address 0.0.0.0 and IPv6 address ::0 are unspecified addresses
            that cannot be used as a target address.
      Parameter name: hostName
System.ArgumentException: IPv4 address 0.0.0.0 and IPv6 address ::0
      are unspecified addresses that cannot be used as a target address.
Parameter name: hostName
   at System.Net.Dns.HostResolutionBeginHelper(String hostName, Boolean justReturnParsedIp, Boolean throwOnIIPAny, AsyncCallback requestCallback, Object state)
   at System.Net.Dns.BeginGetHostAddresses(String hostNameOrAddress, AsyncCallback requestCallback, Object state)
   at System.Net.Dns.<>c.<GetHostAddressesAsync>b__25_0(String arg, AsyncCallback requestCallback, Object stateObject)
   at System.Threading.Tasks.TaskFactory`1.FromAsyncImpl[TArg1](Func`4 beginMethod, Func`2 endFunction, Action`1 endAction, TArg1 arg1, Object state, TaskCreationOptions creationOptions)
   at System.Threading.Tasks.TaskFactory`1.FromAsync[TArg1](Func`4 beginMethod, Func`2 endMethod, TArg1 arg1, Object state)
   at System.Net.Dns.GetHostAddressesAsync(String hostNameOrAddress)
   at FubarDev.FtpServer.MultiBindingTcpListener.StartAsync()
   at FubarDev.FtpServer.FtpServer.<ExecuteServerListener>b__37_0()

In any event, the web application was just being used for testing purposes, so if 0.0.0.0 works in the console app then my issue is resolved.

from ftpserver.

ArrowCase avatar ArrowCase commented on July 20, 2024

0.0.0.0 does not appear to work. The application starts up successfully, but the FTP server cannot actually be reached, locally or from outside the network.

Note that I'm 100% sure that my connectivity/firewalls/etc. are set up properly. If I bind to 127.0.0.1, I can connect to the server locally, and if I bind to 10.0.0.4 I can connect locally or remotely. If I switch from 10.0.0.4 to 0.0.0.0, local and remote access both stop working.

from ftpserver.

chaseaucoin avatar chaseaucoin commented on July 20, 2024

So i have been having the same issue trying to get this containerized. I borught down a local copy and instead of using Dns.GetHostAddressesAsync in the MultiBindingTcpListener I added the following bits of code. Which got everything connecting up fine but now I'm having an issue with PASV beause I have to have well a well defined port range for a containers.

if(_address == "0.0.0.0") { try { Port = StartListeningAll(_port); return; } catch { Stop(); throw; } }

`
private int StartListeningAll(int port)
{
var selectedPort = port;

        var listener = new TcpListener(IPAddress.Any, selectedPort);
        listener.Start();

        if (selectedPort == 0)
        {
            selectedPort = ((IPEndPoint)listener.LocalEndpoint).Port;
        }

        _listeners.Add(listener);

        return selectedPort;
    }

`

from ftpserver.

ArrowCase avatar ArrowCase commented on July 20, 2024

@fubar-coder What do you think about allowing the user to specify an IPAddress instead of a string in the FtpServerOptions? I'd be happy to submit a PR along those lines.

from ftpserver.

chaseaucoin avatar chaseaucoin commented on July 20, 2024

@fubar-coder What do you think about allowing the user to specify an IPAddress instead of a string in the FtpServerOptions? I'd be happy to submit a PR along those lines.

The only thing to keep in mind is backwards compatibility. Gotta be able to do either.

from ftpserver.

fubar-coder avatar fubar-coder commented on July 20, 2024

I'd gladly take this PR 👍

from ftpserver.

pnuzhdin avatar pnuzhdin commented on July 20, 2024

@fubar-coder could you, please, release the fix to NuGet?

from ftpserver.

rhegner avatar rhegner commented on July 20, 2024

I stumbled upon this thread while digging into the sources for trying to find a way to listen on a given port for both IPv4 and IPv6 connections.

Let me share two thoughts about the PR:

from ftpserver.

fubar-coder avatar fubar-coder commented on July 20, 2024

I just released 2.1.1

from ftpserver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.