none
connecting socket from behind a proxy server RRS feed

  • Question

  • We are sending  messages to destination server using socket with customized protocol (not HTTP), It was working fine.

    But we don't have direct access now and we have to use proxy(http, 8080) to communicate with the destination.

    Is this possible?, if YES can any one please help us here.


    Wednesday, April 6, 2016 7:34 AM

Answers

  • Hi santhubabu,

    Sorry for late reply.

    >>"We are sending  messages to destination server using socket with customized protocol (not HTTP)"

    Did you use WCF on your server side?

    >>"But we don't have direct access now and we have to use proxy(http, 8080) to communicate with the destination. "

    Since WCF is not dependent on any communication protocol. If you use WCF as your communication program, it is easy to change your customized protocol as http(just need to change WCF binding).

    In addition, if you use native socket, you could wrap your customized protocol message in the HTTP message when sending it from client side and unwrap it on server side. It need to redesign your application.

    Best Regards,
    Li Wang


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, April 8, 2016 3:31 AM
    Moderator
  • If your proxy server supports SOCKS, then no matter your communication uses TCP or UDP, it can be forwarded.

    Note that to use this your code will need some modification. See an example implementation here. Also be aware that in the comment section that there is someone note that there is a bug in the code.

    Wednesday, April 13, 2016 8:52 AM
    Answerer

All replies

  • Hello,

    I have moved your thread to this forum for better support.

    Thanks for your understanding.

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, April 8, 2016 2:54 AM
  • Hi santhubabu,

    Sorry for late reply.

    >>"We are sending  messages to destination server using socket with customized protocol (not HTTP)"

    Did you use WCF on your server side?

    >>"But we don't have direct access now and we have to use proxy(http, 8080) to communicate with the destination. "

    Since WCF is not dependent on any communication protocol. If you use WCF as your communication program, it is easy to change your customized protocol as http(just need to change WCF binding).

    In addition, if you use native socket, you could wrap your customized protocol message in the HTTP message when sending it from client side and unwrap it on server side. It need to redesign your application.

    Best Regards,
    Li Wang


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, April 8, 2016 3:31 AM
    Moderator
  • Hi Li Wang,

    Thanks for your reply,

    Let me put it my query in different way

    1) Is it possible to communicate with the server by using Socket/TCP through proxy,

    If yes then please tell me the steps(if possible give an example)

    2) In my case server is not ready to accept any HTTP requests, other than TCP(we send messages with customized formatted header&body, each message starts PP then only the server will accept the requests from client).

    I hope my query is clear now.

    Please help me ASAP.

    Wednesday, April 13, 2016 6:38 AM
  • If your proxy server supports SOCKS, then no matter your communication uses TCP or UDP, it can be forwarded.

    Note that to use this your code will need some modification. See an example implementation here. Also be aware that in the comment section that there is someone note that there is a bug in the code.

    Wednesday, April 13, 2016 8:52 AM
    Answerer