Commit Graph

26 Commits

Author SHA1 Message Date
Andrew Dunham
00783e79ec httpu: add context.Context and related interface
This adds a new interface for httpu that supports a Context, and uses
that context to set a deadline/timeout and also cancel the request if
the context is canceled. Additionally, add a new method to the SSDP
package that takes a ClientInterfaceCtx.

Updates #55

Signed-off-by: Andrew Dunham <andrew@du.nham.ca>
2023-08-29 19:12:39 +01:00
Steve Hellwege
9278656124 Allow http.Client used in discovery to be modified (typically for security reasons)
[why]
The importing application may have some specific security requrirements that necessitate
a change to the http.Client or http.Transport used when fetching the xml from the UPnp server.
For example, the importing application may want to restrict localhost calls which could be
made by an attack server on the local network.

[how]
Create a global HTTPClient which defaults to http.DefaultClient.  This allows the importing
application to modify this global if it wishes to make changes to the http.Client/http.Transport
used when fetching the xml from the UPnP server.
2023-02-12 17:29:00 +00:00
hzy
d8bd5d2d52 More functions support Context 2022-10-02 14:55:49 +01:00
mhhcbon
e739c716b4 #48: Add local address information 2022-03-22 09:50:46 +00:00
John Beisley
33cdcbb30d Fix #41 - collisions with same USN as multiple locations. 2021-06-26 17:01:14 +01:00
julianknodt
16e24d5762 Remove direct dependency on charset reader 2021-06-19 23:10:24 +01:00
John Beisley
36abb0b21b Discover devices on all the host's capable network interfaces. 2020-05-16 11:59:03 +01:00
John Beisley
0c863b7f0d Add a command to display all SSDP discoveries on local network. 2020-05-16 11:58:37 +01:00
John Beisley
9f336b0025 Minor comment fix that could mislead. 2015-06-06 11:04:25 +01:00
John Beisley
9e7590f139 Fixes #9 - reacquire previously discovered device by URL.
Some more changes will be required for this to be supported by the dcps
packages.
2015-06-06 11:01:33 +01:00
Duarte Avelar
7c18e85798 Changes the requestXml method to not use the default 30 second get timeout, uses 3 seconds instead. 2015-06-02 11:20:27 -04:00
Huin
c57ae84388 Fix CharsetReader creation.
Fixes #7
2015-04-06 14:16:50 +01:00
Jianfei Wang
4566387de9 support xml encoding other than utf-8 2015-03-07 14:57:28 +08:00
John Beisley
251dddb253 Remove debug logging left in by mistake. 2014-01-06 20:15:29 +00:00
John Beisley
8a169ca3f7 Fix DiscoverDevices to work with absent root.URLBaseStr.
This is particularly important as URLBaseStr should never be present in
UPnP/1.1.
2014-01-05 19:39:24 +00:00
John Beisley
6856f9618d Add example code, and improve the facing docs slightly. 2013-12-31 20:49:32 +00:00
John Beisley
03572e5988 Small fixes and removals, update discoverigd.go. 2013-12-31 18:36:26 +00:00
John Beisley
6a9b6ed1a9 Documentation update. 2013-10-06 22:06:22 +01:00
John Beisley
914072fdd8 Separate lower-level API into separate packages. 2013-10-06 13:23:11 +01:00
John Beisley
e8e520e578 Add documentation comments. 2013-10-06 13:14:31 +01:00
John Beisley
61577bd15b Seems that searching for a service also works. 2013-09-29 16:15:35 +01:00
John Beisley
1b8d66b887 Add SOAP action support. 2013-09-29 11:23:10 +01:00
John Beisley
b36f8b301e Correct service names, add standards reference. 2013-09-28 18:07:05 +01:00
John Beisley
26ceb1478f Keep things generic for the time being. Refactor for simplicity. 2013-09-28 17:57:51 +01:00
John Beisley
407136030e Separated various levels of protocol out.
Specifically:
* HTTPU
* SSDP
* UPNP

Also now supports multiple discoveries from a search.
2013-09-28 00:09:38 +01:00
John Beisley
fca075a6d5 Discovery of IGD vaguely in place. Start of parsing device schema. 2013-09-26 23:11:06 +01:00