Comments (8)
Thanks for reporting!
cc: @sirMackk
from zeronet.
Hey @arthurlutz , thanks for reporting this. I'll get on fixing this today evening. Could you please share what OS you're using as well as Python version?
from zeronet.
I think I have the fix for this on my fork's master. I'll get to give it a test on two routers tomorrow and hopefully report back a success.
from zeronet.
For unknown reason it stopped working for me. (nothing changed: same version that worked before, same router, same computer)
The ssdp discovery UDP packets not even visible using packet analyzer (smartsniff)
If i put sock.bind(("192.168.1.10",999))
to _m_search_ssdp it wokring fine also tried sock.bind(("",999))
, but no luck. Any idea?
from zeronet.
Made it work by detecting local ips (+added some logging, fixed the successful run check and it also can be run by standalone using python UpnpPunch.py
):
https://gist.github.com/HelloZeroNet/5133c7f03030620c278f
Please test :)
Update#1:
socket.gethostbyname_ex('') does not works on linux, but the getsockname() gives the correct answer, so it should work there.
>>> socket.gethostbyname_ex('')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
socket.herror: [Errno 4] No address associated with name
>>> s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
>>> s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
>>> s.connect(('239.255.255.250', 1))
>>> s.getsockname()[0]
'176.231.40.130'
Result on my windows pc:
>>> socket.gethostbyname_ex('')
('short-pc', [], ['192.168.1.10'])
>>> s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
>>> s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
>>> s.connect(('239.255.255.250', 1))
>>> s.getsockname()[0]
'127.0.0.1'
it worked before, so probably sometomes the s.getsockname()[0] returning the '192.168.1.10' ip as answer
if we can find a way to list available ip address on mac/linux then we can also add them to probe iplist
Update#2:
Added this one too, because it returns correct ip on both platform:
>>> s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
>>> s.connect(('8.8.8.8', 0)) # Using google dns route
>>> s.getsockname()[0]
'192.168.1.10'
from zeronet.
Whoa, thanks! I'll test it out soon as I'm home today. Got a windows box
and two routers to test it.
On Mar 7, 2015 4:35 PM, "ZeroNet" [email protected] wrote:
Made it work by detecting local ips (+added some logging, fixed the
successful run check and it also can be run by standalone using python
UpnpPunch.py):
https://gist.github.com/HelloZeroNet/5133c7f03030620c278fPlease test :)
—
Reply to this email directly or view it on GitHub
#54 (comment).
from zeronet.
I checked out the code and it works on both a linux machine and a windows machine on two different routers and it forwards the port without a hitch. Nice job on update 2 - that was the trickiest part. Should we leave it on my fork for more testing or should I submit a PR?
from zeronet.
I think its clearly fixes some problems, so the PR is welcomed
from zeronet.
Related Issues (20)
- All the ZeroNet forks and releases should be signed
- 错误 HOT 1
- Potential SQL Injection HOT 4
- How to use ZeroNet on Android? HOT 10
- zeroid not working for create id HOT 4
- Spammers attack ZeroNet with hostile forks in order to defraud ZeroNet users. HOT 41
- UnboundLocalError: local variable 'err' referenced before assignment
- Unhandled exception: AttributeError: 'Site' object has no attribute 'greenlet_manager'
- ZeroNet version
- Unhandled exception: ModuleNotFoundError: No module named 'socks'
- tracker connection error detected and content.json downloading failed even using tor with bridge HOT 1
- ZeroNet's successor: The Peer-to-Peer Network HOT 4
- Security problem on ZeroMail (and all zeromail clones) need to be allowed [email protected]: (the auth address), malicious user can read, delete, send messages have full access to your mailbox! HOT 3
- ReDoS in built-in file editor (UiFileManager) due to outdated codemirror lib
- Hello Dev . Command not work
- Unhandled exception: RuntimeError: dictionary changed size during iteration HOT 2
- Unhandled exception: AttributeError: 'ConfigPlugin' object has no attribute 'getCmdlineValue'
- UI Change For the Website HOT 1
- Zeronet HOT 2
- offline, moving data using esp or usb flash
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 zeronet.