smeshlink / CoAP.NET

A C# implementation of the CoAP protocol
open.smeshlink.com/CoAP.NET/
Other
159 stars 79 forks source link

Disable well-known #73

Open lucabovo opened 2 years ago

lucabovo commented 2 years ago

Hi all, is there any option or configuration to disable the /.well-known path?

We need it for a public CoAP Server instance that we are running without authentication because of a limitation of field devices.

Thanks in advance for your help.

lucabovo commented 1 year ago

Hi @longshine @martindevans @SiMet @robreeves @delmet @billpratt, any news about this request?

Please let me know, thank you.

SiMet commented 1 year ago

I think you could create your own implementation of IServer. Please see CoapServer class and try to create your own.

I see that last commit was done 7 year ago.

longshine commented 1 year ago

@lucabovo Hi there. Sorry for the late response. This repo is not actively maintained anymore. As for your question, I suggest you could extend the CoapServer and customize it as you require.

For example, to remove .well-known you may have code like this:

class CoapServerWithoutWellknown : CoapServer
{
    public CoapServer(ICoapConfig config, params Int32[] ports)
            : base(config, ports)
    {
        Resource wellKnown = _root.GetChild(".well-known")
        _root.Remove(wellKnown)
    }
}
lucabovo commented 1 year ago

@molinomatteo