Comments (11)
When this issue be published to nuget?
Now remote address is not worked in docker container.
from ftpserver.
You can use 0.0.0.0 instead.
from ftpserver.
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.
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.
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.
@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.
@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.
I'd gladly take this PR 👍
from ftpserver.
@fubar-coder could you, please, release the fix to NuGet?
from ftpserver.
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:
- The existing implementation allows to pass in a null/empty hostname which then defaults to
IPAddress.Any
: The proposed change does not seem to handle that special of a null/empty address (or maybe I don't see it). For backwards compatibility I think it should. - It looks like the recommended way to listen on a port in a dual-mode way is using
TcpListener.Create(port)
, see https://blogs.msdn.microsoft.com/webdev/2013/01/08/dual-mode-sockets-never-create-an-ipv4-socket-again/
from ftpserver.
I just released 2.1.1
from ftpserver.
Related Issues (20)
- UseImplicitTls throws error
- IFTPServer.Status Never Resets HOT 1
- Strange Filezilla behavior HOT 1
- Docker container PASV not able to connect HOT 4
- How to reject non-encrypted connections when I use the TLS function? HOT 2
- Cant stop the Server HOT 2
- LANG catalog loader - unnecessary NGettext dependency and debug log messages HOT 2
- ServerCertificate HOT 2
- BUG: FtpConnection.cs HOT 1
- FtpServerBuilderExtensionsForChecks.cs IFtpConnectionCheck HOT 1
- Memory leak because of Task.Delay(-1, token) HOT 3
- Bug inactivity timeout HOT 1
- Configure multiple command ports HOT 3
- Abnormal operation of DEMO program HOT 1
- How to make a directory read only
- Event/Trigger in server code when a new file was created by client
- Missing logger in XrmdCommandHandler and RmdCommandHandler
- A simple help wouldn't be bad at all friends 💥 HOT 1
- Disconnects from server every 60 seconds when using FTP and FTPS HOT 2
- InMemoryFileSystem documentation HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ftpserver.