-
Notifications
You must be signed in to change notification settings - Fork 466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduced new property 'url' in MQTTWebsocketTransport to accept custom url. #461
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @mendirattanishant. Added few comments.
Also, can we add some tests around this?
/** url an NSString containing the websocketurl | ||
* defaults to @"" | ||
*/ | ||
@property (strong, nonatomic) NSString *url; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not NSURL
and nil by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made the changes. Let me know if they look fine.
@@ -34,8 +36,15 @@ - (instancetype)init { | |||
- (void)open { | |||
DDLogVerbose(@"[MQTTWebsocketTransport] open"); | |||
self.state = MQTTTransportOpening; | |||
NSMutableURLRequest *urlRequest = nil; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of this, can we check:
if url == nil
inside endpointURL
and return it, otherwise do the same?
Great! Thank you @mendirattanishant. |
@jcavar should I update the readme? |
Would be nice, yes. |
Inject
URL
inMQTTWebsocketTransport
.AWS IoT gives self signed URLs. Using the
url
property, user can set the url property directly instead of usingMQTTWebsocketTransport
methodendpointURL
framing it for you using port, tls, etc.