rejetto / hfs2

web based file server
https://rejetto.com/hfs
GNU General Public License v3.0
601 stars 131 forks source link

Hopefully IPv6 will be supported. #1

Closed cocos56 closed 4 years ago

cocos56 commented 4 years ago

IPv4 addresses are now exhausted. This have become one of the factors restricting the development of the Internet. The Chinese government and the ministry of industry and information technology are working hard on IPv6. So far, there are more than one billion IPv6 users in China. So there is an urgent need for applications that support IPv6.

As we all know, without a global network IP address, it is difficult for others to download to the files we have shared. And in many cases, they can only access the files by connecting to the same router as us.

cocos56 commented 4 years ago

In the IPv4 era, the addresses given to machines were private, but in the IPv6 era, they were global.

rejetto commented 4 years ago

hi, are you already using HFS without ipv6? with this repo i'm currently in the process of making it work correctly as it was, as i changed the dev environment. Only then I'll be able to make improvements. I'm not currently using ipv6 myself, and i'm not sure of what it takes to support it. I may find help from other people on github. We'll see.

cocos56 commented 4 years ago

In the IPv4 era you can bind 0.0.0.0 represents binding all IPv4 addresses of the host, in the IPv6 era you can bind :: represents binding all IPv6 addresses of the host,.

cocos56 commented 4 years ago

In China, all cell phone base stations have been retrofitted, so IPv6 is generally supported for mobile traffic. I don't know about Italy.

You can test with https://ipv6-test.com/

image

cocos56 commented 4 years ago

Now I support IPv6 by running the following code on Windows : netsh interface portproxy add v6tov4 listenaddress=:: listenport=80 connectaddress=127.0.0.1 connectport=80

image

cocos56 commented 4 years ago

You can try to access my HFS through the link below with IPv4 : http://sz.coco56.top:44165/ http://sz.coco56.top:39688/

cocos56 commented 4 years ago

And try to access my HFS through the link below with IPv6 : http://1.coco56.top/ http://5.coco56.top/

rejetto commented 4 years ago

I got 1Gbps home, but I also tried with my mobile connection, and for both the test says: IPv6 Not supported

rejetto commented 4 years ago

Still I can access your HFS on the v4 urls but not on the v6

cocos56 commented 4 years ago

According to https://www.china-ipv6.cn/#/index

You can see if other network operators in your area support IPv6. I have a feeling that some parts of Rome might support IPv6.

cocos56 commented 4 years ago

I have an aliyun server with a golbal IPv4 address and an IPv6 private address. If you need to test IPv6, I can provide it to you.

image

cocos56 commented 4 years ago

You can test it with its own IPv6 address, such as ::1, not the IPv6 addresses of other machines.

image image

rejetto commented 4 years ago

I have an aliyun server with a golbal IPv4 address and an IPv6 private address. If you need to test IPv6, I can provide it to you.

thanks for your offer! when i'll be able to work on ipv6 we'll see how to do it. Or other people may work on it first...

rejetto commented 4 years ago

hfs.zip

would you please see if this build has some support for ipv6 ?

cocos56 commented 4 years ago

Thank you, it now supports IPv6.

You can visit http://3.coco56.top/

image image

cocos56 commented 4 years ago

But this version cannot access http://127.0.0.1/

cocos56 commented 4 years ago

This version may only support IPv6.

cocos56 commented 4 years ago

Can you make it support both IPv6 and IPv4 ?

rejetto commented 4 years ago

that was just an experiment, but the result is very interesting. You'll probably see ipv6 + ipv4 in next beta version or in final release.

rejetto commented 4 years ago

If you have time, would you tell me which features you find that needs to be adapted for ipv6 ? At the moment i only know of 'bans'. Thanks

cocos56 commented 4 years ago

It applies to scenarios where resources are shared globally.

Global IPv4 addresses are now exhausted. This have become one of the factors restricting the development of the Internet.

As we all know, without a global network IP address, it is difficult for others to download to the files we have shared. And in many cases, they can only access the files by connecting to the same router as us.

In the IPv4 era, the addresses given to machines were private, but in the IPv6 era, they were global.

rejetto commented 4 years ago

There was a misunderstanding with my last request. What I meant is: now that HFS will accept ipv6 requests, better than nothing but that's not enough, I will have to work on some other parts that needs to be adapted. For example, if you go to "Limits>Bans", you'll find impossible to enter ipv6 addresses, so you won't be able to use that specific feature. There may be others. I hope it is clearer now.

coco5666 commented 4 years ago

https://rejetto.com/wiki/index.php?title=HFS:_IP_masks

image image

image

coco5666 commented 4 years ago

Ok, thank you. I see what you mean. I don't think there's anything special to do except Ban.

rejetto commented 4 years ago

Can you make it support both IPv6 and IPv4 ?

can you tell me if this build works with both ipv6 and ipv4 ? hfs.zip

cocos56 commented 4 years ago

Can you make it support both IPv6 and IPv4 ?

can you tell me if this build works with both ipv6 and ipv4 ? hfs.zip

Only support IPv4, not support IPv6.

rejetto commented 4 years ago

if you tell me how to make a test myself, i will not bother you anymore with more builds :) maybe there's a way i can do it on my pc or in my LAN, even if the ISP is not ready yet. Using this last build, if i try to connect to ::1 it works, so it must not be a good test.

cocos56 commented 4 years ago

run netstat -an You should get the following results :

TCP 0.0.0.0:80 0.0.0.0:0 LISTENING TCP [::]:80 [::]:0 LISTENING

image image

rejetto commented 4 years ago

thanks! so this should be good. Let me know hfs.zip

cocos56 commented 4 years ago

Both Ipv4 and Ipv6 support are now fully implemented. But Ipv6 access can sometimes be slow. image

cocos56 commented 4 years ago

Maybe the performance of the machine I tested was too poor.

rejetto commented 4 years ago

cool! i will try to include more ipv6 support for next release.

cocos56 commented 4 years ago

Ok, thank you!