-
Notifications
You must be signed in to change notification settings - Fork 34
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
HTTPS?? #16
Comments
I am also looking forward for https support. As I am not able to handshake currently with https based server. |
Any update on this issue, as I am also not able to handshake and no error is being thrown even. |
It does work with HTTPS, it might be that your selected framework version doesn't have the corresponding tls version "activated".
|
Thanks for the quick response. But with this change as well it does not work. The problem is it does not handshake. It just keeps all status 'connected', 'disconnected' and 'handshook' as false. Also, it does not throw any errors as well so not getting an idea of what is wrong and where it is wrong. Is there any way to identify the issue? Also, is there any tool to test the configuration so that I can ensure that server-side configuration is well. Jignesh |
You could try to check the network traffic with tools like fiddler or use "system.diagnostics". Todo so merge the follwoing xml into your <system.diagnostics>
<trace autoflush="true" />
<sources>
<source name="System.Net">
<listeners>
<add name="MyTraceFile"/>
</listeners>
</source>
</sources>
<sharedListeners>
<add name="MyTraceFile" type="System.Diagnostics.TextWriterTraceListener" initializeData="System.Net.trace.log" />
</sharedListeners>
<switches>
<add name="System.Net" value="Verbose" />
</switches>
</system.diagnostics> |
Thanks, Fiddler was a trick. I can now see that it gets failed with "failureReason=401::Request requires authentication" I use below code for authentication
It gives with JSON with two values access_token and instance_url. And following is the code for handshake.
So, I am sending the access token to the handshake method. Even though it is not working. Do you find anything wrong here? Jignesh |
I'm not sure if Maybe have a look at #19 and set the header this way. |
Thanks, Ohaucke But this also does not work and we get same 401:: Request requires authentication error. Btw, we got other information from my client and in that, they give Initial Auth Token. I do not have any idea about as I am not salesforce developer. I am a .net developer for learning management system site and my need is to fetch some data from client's salesforce to use in my system. I searched on google and found that the initial token will be used to create a client. Do you have any idea about it? or is there any document where I can know step by step call requirement to create an application which keeps the connection with salesforce system and get real-time data from them. Jignesh |
Did you check with fiddler if the Basiclly you need to create a With the access token and the patch from #19 you create the client with the |
Thanks Ohaucke, We removed nuget reference and downloaded the code from this repository. In that code the header related code was missing which we have added from patch you shared in your previous post This change has made authorization done. Now I can get following JSON as response. [{"ext":{"replay":true,"payload.format":true},"minimumVersion":"1.0","clientId":"4d1.........","supportedConnectionTypes":["long-polling"],"channel":"/meta/handshake","id":"0","version":"1.0","successful":true}] Thanks for all your help. Jignesh |
Hi Ohaucke, As per my above last post on 27 May, I could make the application which open channels and receive messages well. That application is deployed on the Azure as WebJob. The problem we are facing right now that, even the application shows running it stops listening to the messages. It does not throw any error. We just need to restart the application to make it work again. I am clueless about what might be going wrong. Is there any way to write up a code which writes logs on every re-handshaking it does. Or write up code to check if the channel is open or something. Jignesh |
Hi @pateljigu210, |
Thanks Ohaucke, I have implemented listener to "/meta/handshake" and in that listener, I have added code of subscription to other channels. I believe with this whenever it will do re-handshaking the subscription will be reopened. But, will it cover the scenario the connection got closed by the server? Or I shall implement that extension as well. Also when re-handshaking occurs? Jignesh |
I'm not sure, i implemented the extension to create a completely new connection. |
Ok, In that case, I shall implement the extension as well. I saw your code of extension but I do not find anything written for creating a new connection. In OnConnectionError method you just have invoked current object. I am not getting what it will do. What code I need to write in which method of extension to create new connection. Jignesh |
You need to subscribe to the |
@ohaucke - Can you please share example of your code as I am facing the same issue. |
@pateljigu210 - Were you able to resolve the issue, Can you please share the example of code. |
----Below is my code for creating client, adding up the listener to the "meta/handshake" and then handshake BayeuxClient bayeuxClient = new BayeuxClient(endpoint, new[] { transport }); bayeuxClient.handshake(); ---- below is my code of listner public class Listener : IMessageListener
} |
@pateljigu210 - thank you for the code. Did your code also take care of subscribing channels on connection error? Do we need to implement extension for “403:client error” |
No, I have not done that |
@pateljigu210 - Thank you for update. Does it mean that this approach would also handle connection errors, reconnects etc. |
I am not sure, but I believe it does auto-connect on connection errors and while auto-connect re-handshaking happens and on handshaking listener, we have written code to create our actual channel listener. |
Hi Ohaucke, I had implemented the listener to the "/meta/handshake" channel and on the message received on this channel, I am creating listener to other actual channels. But now we are seeing that we are receiving the message on "/meta/handshake" channel very frequently like on every 50 seconds. I am not able to understand why it is doing handshaking so frequently. Can you please guide me on this? Jignesh |
@pateljigu210 Sorry i have no idea |
Does this library work for HTTPS for secure communication? Or does it only support HTTP?
The text was updated successfully, but these errors were encountered: