Comments (5)
Fixed in v0.2.0.
from miniserve.
Good idea. Will do. Of course, you can also go ahead and make a PR if you would like to take a stab at this yourself.
from miniserve.
I just discovered, that it is already capable of running Ipv6, just pass e.g. ::
as interface and it will serve it just fine.
cargo run --release -- -i '::' .
Finished release [optimized] target(s) in 1.25s
Running `target/release/miniserve -i '::' .`
miniserve is serving your files at http://:::8080
Currently serving path /tmp/tmp.Mkfpy6fbam/miniserve
(please note the "wrong" format:
http://:::8080
^-- here
it should be http://[::]:8080
)
There is a problem though.
On linux, it will bind on both, IPv4 and IPv6. On windows on the otherhand, it will only bind on either (source).
So I have a few ideas in mind.
- Check if it is an IPv6 addr and try to bind on both. This will mean we get an error on Linux, but not on windows. Shall be check the OS (on compile- or runtime?) and do different things?
- Check explicitly in
is_valid_interface
for Ipv4 addr (which is trivial :) ) and only accept IPv4 addr on--if
and add another option (maybe--if6
)? - When default is given (no
--if
parameter at all) do a double bind, and only if either option is given (--if
or--if6
) bind to that protocol but not on the other (unless both options are given) - ??? -> Profit?
from miniserve.
One more note: If it is an IPv6, the URL should be displayed like this: `http://[::]:8080'.
from miniserve.
@hellow554 Thanks for considering this so thoroughly!
About your 1.: I don't quite understand. How would you even go about binding on both interfaces if you provide an IPv6? It could just be that an interface does not even have an IPv4 even if it has an IPv6. Basically, I think that if an explicit IPv4 or IPv6 is given, we should not try to bind on anything except those provided.
I think --if
should accept both IPv6 and IPv4. There doesn't really seem to be an issue with that. Also, we should allow for --if
to be called multiple times.
- I agree with this. It should try to bind on all interfaces on both protocols in the correct way on all OS.
from miniserve.
Related Issues (20)
- (systemd) error: unexpected argument ' ' found
- panicked at 'modification time must be after epoch: SystemTimeError(28800s)' HOT 6
- Unable to serve files with embedded newline HOT 2
- hope to add ignore file/dir list parameter HOT 1
- Failed test bind_ipv4_ipv6::case_2 HOT 2
- Does it support hiding some files? HOT 6
- Can't Upload HOT 1
- Add cli flag to disable indexing HOT 1
- Not working with reverse proxy in specific directory HOT 2
- Wget footers : hostname:port is repeated HOT 4
- Feature request: custom subtitle
- rendering markdown files? HOT 12
- Set upload size limit HOT 2
- Save uploaded file atomically HOT 2
- 上传onedrive问题 HOT 4
- How to use HTTPS HOT 1
- Add Support for HSTS to Enhance HTTPS Security HOT 2
- CSS not working when root domain not accessible
- Suggestion - Pin the false positive antivirus alerts HOT 3
- Running with multiple replicas HOT 6
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 miniserve.