named-data / YaNFD

Yet another Named Data Networking Forwarding Daemon
https://pkg.go.dev/github.com/named-data/YaNFD
MIT License
12 stars 10 forks source link

YaNFD WebSocket face cannot recognize local browser #55

Closed zjkmxy closed 11 months ago

zjkmxy commented 11 months ago

As shown in the following code:

https://github.com/named-data/YaNFD/blob/7638527d571945510c6224c09d487168f7740545/face/web-socket-transport.go#L32

WebSocket connections are treated as remote connections blindly. This prevents any WebSocket connection from a local browser announcing routes. However, the NFD wiki states:

Generally, the following faces are local: ...

  • WebSocket face whose remote address is a loopback address

NFD follows the instructions in the wiki and allows local WebSocket connections to announce routes via /localhost/nfd/rib/register command. We should fix YaNFD to make the behavior consistent.