In my javascript I'm doing:
var socket = io.connect('https://socket.xxxxxxxxxxx.net?token=socket1');
And the url in the "network" tab of chrome reads as
"https://socket.xxxxxxxxx.net:3000/socket.io/1/?token=socket1&t=1394492903833"
And I get an ERR_CONNECTION_TIMED_OUT.
I think this is because it's appending port 300 to my url, when, on the server, there is nothing running on port 3000.
My environment is a node.js server running on my local machine, and serving files through express, if this matters
The fix for this is to explicitly add the correct port, in my case 443, to the connection url.
Like so
https://socket.xxxxxxxxx.net:443/socket.io/1/?token=socket1&t=1394492903833
Related
I have local computer and remote server. Remote server is isolated and is only accessible with this computer. I want to connect to site from server, let it be https://example.com/site
I tried to make a tunnel via ssh -R 6761:example.com:80 remote-server. But when I am trying to use wget http://localhost:6761/site on the remote server - it doesn't work and show 404 whilst wget http://example.com/site working well on local computer.
What I am doing wrong?
You cannot tunnel HTTP that way.
The name of the server you are trying to reach will be included in the request (the Host header), but it will most likely only listen to example.com, not localhost.
You will need to set up a HTTP Proxy (Forward Proxy) on your local machine and tell your http client(s) to use that. (How depends on the client.)
I am new to node.js and am trying to get into the hang of actually using it. I am very familiar with JavaScript so the language itself is self-explanatory but the use of Node.js is quite different from the browser implementation.
I have my own remote virtual server and have installed Node and the Package Manager and everything works as expected. I am not exactly a server extraordinaire and have limited experience with the Terminal and Apache Configurations.
I can run my server using:
nodejs index.js
Which gives me: listening on *:3300 as expected.
I can then access my localhost from the terminal using: curl http://localhost:3300/ which gives me the response I expect.
Given that the website that links to my server is https://example.com, how do I allow this link to access: http://localhost:3300/ so that I can actually use my node server in production? For example, http://localhost:3300/ runs a Socket Server that I would like to use using Socket.io on https://example.com/chat.html with the JavaScript:
var socket = io.connect('http://localhost:3300/', {transports: ['websocket'], upgrade: false});
Ok, this question has nothing to do with nodeJS.
localhost is a hostname that means this computer. it's equivalent to 127.0.0.1 or whatever IP address you can refer to your computer.
After the double colon (:) you enter the port number.
So if you want to make an HTTP call to a web-server running on your server, you have to know what is the IP address of your server, or the domain name, and then you call it with the port number where the server is running.
For Instance, you would call https://example.com:3300/chat.html to make an HTTP call to a server running on example.com with port 3300.
Keep in mind, that you have to make sure with your firewall configuration, that the specific port is open for incoming HTTP requests.
I have created below setup in Jmeter to run recorded test cases.
Added Thread Group to test plan.
Added HTTP Request Defaults to thread group (in path section i have given url as 'http://localhost:8044')
note: 'http://localhost:8044' is the url which i want to launch on firefox.
Added Recording controller to thread group
In workbench
Added HTTP(S) Test Script Recorder (In port section i have given 8080 as port no)
Now when I recorded test cases and played the test plan- test samples are failing with the following error.
Error:
Response code: Non HTTP response code: java.net.ConnectException
Response message: Non HTTP response message: Connection timed out: connect
Running this setup in virtual machine.I have tried with some other ports like 7070,8055,8044 but still getting same error.
Not sure where the issue is. Can any one please help me on this.
You have to setup the proxy in the browser also with same port that you mentioned in Test Script Recorder
8044 port - is in which server is listening (HTTP Sampler port)
8080 port - is in which proxy server is listening (Test Script Recorder port)
Both are different. we need to configure proxy server port (which we specified in Test Script Recorder) in the browser setting also.
Note: If 8080 is already taken by some other process in your machine, try different port.
Setting up proxy in Firefox:
Options -> Advanced -> Network tab -> Settings button related to Connection -> enter port in Manual Proxy Configuration).
Follow the steps mentioned here:
https://jmeter.apache.org/usermanual/jmeter_proxy_step_by_step.pdf
Add Thread Group to test plan.
Add Transaction controller to thread group
Add HTTP(S)Test Script Recorder to workbench
In HTTP(S)Test Script Recorder set global setting port to 8080,in target controller select the transaction controller in which you want to record the test click on start button before clicking start button you have to set proxy to record the script to do that go to firefox-option-Advanced-Network-Connection click on setting- select manual proxy config-in HTTP proxy give localhost and port 8080 and check the use this proxy server for all protocols .
This works for me.Check if 8080 port used by another process to do so in cmd type netstat -an
The issue is resolved. Recording was not happening because of this.
Firefox default setting will bypass "localhost, 127.0.0.1" from proxy so your JMeter still not able to record it. You have to empty the "No Proxy for" field, by removing the "localhost, 127.0.0.1". Hope this will help.
I removed localhost, 127.0.0.1 from the no proxy field in firefox.
Got the fix from the link https://stackoverflow.com/a/37776363/4715839
Thanks all for sharing your comments.
I have the following situation: 2 hosts, one is a client and the other an HTTPS server.
Client (:<brwsr-port>) <=============> Web server (:443)
I installed Fiddler on the server so that I now have Fiddler running on my server on port 8888.
The situation i would like to reach is the following:
|Client (:<brwsr-port>)| <===> |Fiddler (:8888) <===> Web server (:443)|
|-Me-------------------| |-Server--------------------------------|
From my computer I want to contact Fiddler which will redirect traffic to the web server. The web server however uses HTTPS.
On The server I set up Fiddler to handle HTTPS sessions and decrypt them. I was asked to install on the server Fiddler's fake CA's certificate and I did it! I also inserted the script suggested by the Fiddler wiki page to redirect HTTPS traffic
// HTTPS redirect -----------------------
FiddlerObject.log("Connect received...");
if (oSession.HTTPMethodIs("CONNECT") && (oSession.PathAndQuery == "<server-addr>:8888")) {
oSession.PathAndQuery = "<server-addr>:443";
}
// --------------------------------------
However when I try https://myserver:8888/index.html I fail!
Failure details
When using Fiddler on the client, I can see that the CONNECT request starts but the session fails because response is HTTP error 502. Looks like no one is listening on port 8888. In fact, If I stop Fiddler on the server I get the same situation: 502 bad gateway.
Please note that when I try https://myserver/index.html and https://myserver:443/index.html everything works!
Question
What am I doing wrong?
Is it possible that...?
I thought that since maybe TLS/SSL works on port 443, I should have Fiddler listen there and move my web server to another port, like 444 (I should probably set on IIS an https binding on port 444 then). Is it correct?
If Fiddler isn't configured as the client's proxy and is instead running as a reverse proxy on the Server, then things get a bit more complicated.
Running Fiddler as a Reverse Proxy for HTTPS
Move your existing HTTPS server to a new port (e.g. 444)
Inside Tools > Fiddler Options > Connections, tick Allow Remote Clients to Connect. Restart Fiddler.
Inside Fiddler's QuickExec box, type !listen 443 ServerName where ServerName is whatever the server's hostname is; for instance, for https://Fuzzle/ you would use fuzzle for the server name.
Inside your OnBeforeRequest method, add:
if ((oSession.HostnameIs("fuzzle")) &&
(oSession.oRequest.pipeClient.LocalPort == 443) )
{
oSession.host = "fuzzle:444";
}
Why do you need to do it this way?
The !listen command instructs Fiddler to create a new endpoint that will perform a HTTPS handshake with the client upon connection; the default proxy endpoint doesn't do that because when a proxy receives a connection for HTTPS traffic it gets a HTTP CONNECT request instead of a handshake.
I just ran into a similar situation where I have VS2013 (IISExpress) running a web application on HTTPS (port 44300) and I wanted to browse the application from a mobile device.
I configured Fiddler to "act as a reverse proxy" and "allow remote clients to connect" but it would only work on port 80 (HTTP).
Following on from EricLaw's suggestion, I changed the listening port from 8888 to 8889 and ran the command "!listen 8889 [host_machine_name]" and bingo I was able to browse my application on HTTPS on port 8889.
Note: I had previously entered the forwarding port number into the registry (as described here) so Fiddler already knew what port to forward the requests on to.
I'm trying to set up a ssh tunnel using putty so i can view websites which are at my work location. The remote development server (apache) does not accept any incoming calls on port 80, so i'm trying to tunnel through ssh which should work since i'm able to login to my shell account.
I'm using putty 0.60, In my settings ive added a new rule at connection -> tunnels
Ive added source port 80, Destination: remote.domain:80, i tried setting the radio buttons to local, remote, dynamic and the 2nd line to auto, still doesnt seem to work.
Do i need to add something to my windows host file to make apache accept the request?
Any idea's?
Destination should be localhost:80. This is where the remote port is forwarded to.
Then in your hosts file reroute remote.domain to 127.0.0.1.
That should give you access.