Skip to content

Must options.path be FQDN ? #12

@derMani

Description

@derMani

Hi, thanks for your work here.

I am using socket.io-proxy behind a SQUID proxy server, but got a lot of errors (400).

My init config looked this way

process.env.http_proxy = 'http://192.168.0.254';
proxy.init();
var socket = proxy.connect('http:/<mydomain>:61238');

Problem: The program tried to map the /socket.io/ path directly to the URL of the proxy server (192.168...)

I've searched a bit on the web and I saw a hint, that the "path" must be a FQDN value.
So i did this small hack here:

  var options = {
    hostname: typeof proxy !== 'undefined' ? proxy.hostname : hostname,
    port: typeof proxy !== 'undefined' ? proxy.port : port,
    path: requestUrl.pathname + qs,
    method: request.method,
    headers: request.headers
  };
  options.path = 'http://<mydomain>:61238'+options.path;

and it worked.

Question: Is this a problem in my app or squid configuration or is it worth to "fix" this could (for example directly in the options field)?

Regards
Rolf

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions