husarnet开源项目

我要开发同款
匿名用户2021年11月30日
29阅读
开发技术C/C++
所属分类程序开发、网络工具包
授权协议View license

作品详情

HusarnetClient

HusarnetisaPeer-to-PeerVPNtoconnectyourlaptops,serversandmicrocontrollersovertheInternetwithzeroconfiguration.

Keyfeatures:

LowLatency-thankstoPeer-to-Peerconnectionbetweendevices.Afterestablishingaconnection,HusarnetInfrastructure(HusarnetBaseServers)isusedonlyasafailoverproxyifP2Pconnectionisnotpossible.ZeroConfiguration-afterinstallingHusarnetClient,youcanaddnewdevicestoyournetworkwithasinglecommandhusarnetjoin<YOUR_JOINCODE>mydevname(onLinux.Seedocsforotherplatforms).LowReconfigurationTime-incaseofanetworktopologychange(eg.transitionbetweentwoWi-Fihotspots),Husarnetneedsusually1-3secondstoreastablishanewPeer-to-Peerconnection.Lightweight-itworksnotonlyonpopularOSes(currentlyonlyLinuxversionisreleased,Windows,MacOS,Androidcomingsoon)butevenonESP32microcontrollers.ThatmeansyoucanP2PaccessyourthingswithoutIoTserveratall!Secure&Private-packetsneverleaveconnecteddevicesunencrypted,PerfectForwardSecrecy(PFC)enabledbydefault.

Husarnet,init'score,isonebig,automaticallyrouted,IPv6network.RunningHusarnetdaemoncreatesavirtualnetworkinterface(hnet0)withanuniqueHusarnetIPv6addressandassociatedfc94::/16route.Ifyouchoosetodisablethepermissionsystem,anynodecanreachyournodeusingIPv6fc94:...address,butifyouchoosetoleaveitenabled,we'vepreparedanextensivepermissionssystemforyou.Youcanhavemultiplevirtualislands/networks,yourdevicescanaccessmultiplenetworksoryoucanevenshareaccesstothosenetworkswithotherusers!

Thenodesareidentifiedbytheir112-bitIPv6addresses,thatarebasedonthepublickeysofthenode.AllconnectionsarealsoauthenticatedbytheIPv6address.Thispropertymakesitpossibletoestablishconnectionauthenticitywithoutanytrustedthirdparty,basingonlyontheIPv6address!Theconnectionsarealsoalwaysencrypted.

Cryptography:HusarnetusesX25519fromlibsodiumforkeyexchange,withephemeralCurve25519keysforforwardsecrecy.ThehashofinitialpublickeyisvalidatedtomatchtheIPv6address.Thepacketsareencryptedusinglibsodium'sChaCha20-Poly1305secretboxconstructionwitharandom192-bitnonce.

Runtimesafety:HusarnetiswritteninC++usingmodernmemory-safeconstructs.Linuxversiondropsallcapabilitiesafterinitialization.Itonlyretainsaccessto/etc/hostsand/etc/hostnameviaahelperprocess.

IfHusarnetinstanceisnotconnectedtotheHusarnetDashboard,thewhitelist(thinkofitasacrudefirewall)andhostnametablecanonlybechangedbyalocalrootuser.AlltheotherconfigurationcanbechangedusingtheHusarnetDashboardafteryoujoinyourdevicetoanetworkthere.

ThisisthemaindevelopmentrepositoryforalloftheHusarnetClientapps.

FormoregenericinformationpleasehavealookattheHusarnetDocs.

TypicalissuespreventingPeer-to-Peerconnection(thusenjoingalow-latency)andtheirworkaroundsaredescribedintheTroubleshootingGuide.

Repositoryorganizationutildirectory-allthescriptsandutilitiesusedforbuildingandtesting.CIconfigshouldbereferencingthoseinordertomakelocaltestingeasierunixdirectory-maindirforunixplatformcodetestsdirectory-unit(andother)tests(unittestswillrunonx86_64unixplatform)deploydirectory-variousfilesneededfordeployment-likethestaticfilesinourrepositoriesBuildingandpublishing./util/build-prepare.sh-willinstallallrequiredtoolchains,etc-testedonUbuntu20.10Ifyouwanttobumpthecurrentversion(i.e.asapreparationforrelease)-./util/version-bump.py(keepinmindthatallmerges/commitstothedefaultbranchwilltothatautomatically)Ifyouwanttobuild:allplatforms:./util/build-all.shspecificplatform:platformsusingcmake:./util/build-cmake.sh<architecture><platform>CIwillbedoingthesestepsautomaticallywhenranondefaultbranch:bumpandcommitthenewversion"number"buildforallplatformsandarchitectures(whenavailable)testallplatformsandarchitectures(whenavailable)publishtotheinternalrepositorieswaitformanualconfirmationtopublishinthepublicrepoCIwillbedoingthesestepsthenranonanyotherbranch:buildforallplatformsandarchitectures(whenavailable)testallplatformsandarchitectures(whenavailable)Runningtests./util/test-prepare.sh-willinstallrequiredtools./util/test-all.sh-willrunALLtests./util/test-cppcheck.sh-willruncppcheck./util/test-unit.sh-willbuildandrununittests.Assumeshostmachineisx86andrunssomeformofUnixCIextranotes./util/prepare-all.sh-thiswillpreparebothbuildandtestenvironmentsContributors

Thisprojectwaspossiblethanksto:

@zielmicha@m4tx@andrzejwl@pidpawel@konradprLicense

Husarnetisdual-licensed:

GNUPublicLicense-forderivativeprojects-eg.exposingagenericVPNfunctionality.MozillaPublicLicense-forprojectswhereyoulinkHusarnetClientcodewithdifferentprojecttypethanmentionedabove-eg.usingHusarnetClientSDKinESP32IoTproject.

SeeLICENSE.txtfordetails.

声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论