coddingtonbear / obsidian-local-rest-api

Unlock your automation needs by interacting with your notes in Obsidian over a secure REST API.
MIT License
607 stars 56 forks source link

Can the plugin support host ip rather than 127.0.0.1 #17

Closed kchen0x closed 2 years ago

kchen0x commented 2 years ago

My PC's IP address is 10.0.x.x. And I tried call the local api with both 127.0.0.1 and 10.1.x.x:

GET / HTTP/1.1
Authorization: Bearer xxx
User-Agent: PostmanRuntime/7.29.0
Accept: */*
Postman-Token: c702eb23-b467-4516-98d8-ad4a4338cf41
Host: 127.0.0.1:27123
Accept-Encoding: gzip, deflate, br
Connection: keep-alive

HTTP/1.1 200 OK
X-Powered-By: Express
Access-Control-Allow-Origin: *
Content-Type: application/json; charset=utf-8
Content-Length: 152
ETag: W/"98-/ubTTso4uaXjt2NmuEnNOi94qUE"
X-Response-Time: 0.627ms
Date: Mon, 25 Apr 2022 03:54:03 GMT
Connection: keep-alive
Keep-Alive: timeout=5

{
"status": "OK",
"versions": {
"obsidian": "0.14.6",
"self": "1.3.1"
},
"service": "Obsidian Local REST API",
"authenticated": true
}

It works. However:

image