MQTTnet icon indicating copy to clipboard operation
MQTTnet copied to clipboard

Is it possible to access to requested URL on client connect?

Open ap-ubeac opened this issue 6 years ago • 3 comments

I have a server running mqttnet and I have given unique subdomain for each of clients(client1.x.com, client2.x.com, ...). I have also created username/password for the devices which want to publish/subscribe to the server. I want to validate mqtt client before connecting to server and to validate the client I need to access the calling url to extract the subdomain and then validate assigned username/password. How can I access to the URL?

ap-ubeac avatar Jun 05 '19 00:06 ap-ubeac

Hi, that is not supported at the moment. But "named endpoints" (which are basically identified via its unique ID) are on my list already. Best regards Christian

chkr1011 avatar Jun 06 '19 19:06 chkr1011

Perfect, thanks!

ap-ubeac avatar Jun 06 '19 21:06 ap-ubeac

I just need to know the URL, not binding to named endpoint. Is there anyway to determine the called endpoint rather than IP address?

ap-ubeac avatar Jun 06 '19 21:06 ap-ubeac

With the latest version you now have access to the internally used HTTP Context when using ASP.NET. Please check the property ChannelAdapter in class ValidatingConnectionEventArgs. The summary comment explains how to cast the value properly. If this does not fix this issue, please reopen the ticket.

chkr1011 avatar Sep 14 '22 06:09 chkr1011