Http connect to proxy to websockets | Unix Linux Forums | Web Programming

  Go Back    


Web Programming Discuss Web Programming and Web Server Administration, including LAMP, Apache, MySQL, HTML, SEO, and other Web APIs and topics.

Http connect to proxy to websockets

Web Programming


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 03-14-2013
glev2005 glev2005 is offline
Registered User
 
Join Date: Oct 2008
Last Activity: 19 July 2014, 10:56 PM EDT
Posts: 276
Thanks: 20
Thanked 6 Times in 6 Posts
Http connect to proxy to websockets

I am having a hard time with this one. We have a websocket server listening on port 80 at myserver.com/wsDemo?ID=12. We need to test a client program by connecting it to this server through a proxy. I am trying nginx 1.2.7 as the proxy on port 8080, running on proxy-server. We want the client to connect to the proxy using http connect method, and then have the proxy create a tunnel to the myserver.com/wsDemo?ID=12 websocket app server. Here is my nginx config:

Code:
http { include /etc/nginx/mime.types; default_type application/octet-stream;

log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                  '$status $body_bytes_sent "$http_referer" '
                  '"$http_user_agent" "$http_x_forwarded_for"';

access_log  /var/log/nginx/access.log  main;

sendfile        on;
#tcp_nopush     on;

#keepalive_timeout  0;
keepalive_timeout  65;

gzip  on;
server{
    listen  8080;
    listen  80;

    location /wsDemo?ID=12 {
            proxy_pass http://myserver.com:80/wsDemo?ID=12;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
    }
}

# Load config files from the /etc/nginx/conf.d directory
# The default server is in conf.d/default.conf
include /etc/nginx/conf.d/*.conf;
}

---------- Post updated at 01:50 PM ---------- Previous update was at 01:48 PM ----------

Currently, it seems like we just get 400 errors.
Sponsored Links
    #2  
Old 03-14-2013
DGPickett DGPickett is offline Forum Advisor  
Registered User
 
Join Date: Oct 2010
Last Activity: 31 July 2014, 4:55 PM EDT
Location: Southern NJ, USA (Nord)
Posts: 4,390
Thanks: 8
Thanked 535 Times in 514 Posts
two listens seems wrong. The proxy listens on 8080, the web server is already on 80. Usually proxies just tcp connect for you, tunnels are for ssh.

Last edited by DGPickett; 03-14-2013 at 03:47 PM..
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Websockets proxy on CentOS Linux? glev2005 Emergency UNIX and Linux Support 3 07-23-2013 12:36 AM
Completed SIMPLE HTTP PROXY CHECKER 654321 Shell Programming and Scripting 4 09-23-2012 02:32 PM
Unable to access http site using wget through proxy memonks Shell Programming and Scripting 2 06-21-2009 01:32 AM
Blocking HTTP tunnel in squid proxy 2.5 vishwanathhcl IP Networking 1 03-11-2009 02:06 PM



All times are GMT -4. The time now is 02:33 AM.