HTTP requests not working on aws ec2 - http

I am building an app in node.js and I’m using AWS EC2 to host it. However, my HTTP requests are not working.
My app is split into two repositories: app-ui and app-server. app-server contains all of my server side code/API’s. In app-ui, I am making simple POST requests such as:
$.ajax({
type: "POST",
url: "http://ec2-xx-xxx-xx/api/users",
success: function(data) {
console.log(data);
},
error: function(a) {
console.log(a);
}
});
However, I keep getting the net::ERR_CONNECTION_TIMED_OUT error.
Does anyone know what might be happening?

Add an inbound rule for the security group attached to your server for the specific port you're using.

I'm having the same issue this is because the amazon servers were down today, but take a look on your server to see if it is working in my case:
/etc/init.d/apache2 status
Response:
Active: active (running) since Wed 2017-03-01 02:21:53 UTC; 2h 3min ago
Docs: man:systemd-sysv-generator(8)
Apparently the S3 was one of the services down and also the routing system, if your server was located on AWS EST side you will find this issue, this affected several apps like HockeyApp and Trello
Take a look on the current status: status.aws.amazon.com
Of course assuming that you have the security groups, the elastic or static ip's set and configured and that you see this issue on all your site and not just on your API

I was struggling with the same situation. I managed it. Go to AWS -> login -> ec2 -> select the options in the left sidebar "security and groups". then select your default instance on the right side that is listed in the table then clicked the action button on the top of the table. that will show the inbound menu.
there you click the "add rule" button. there the type is "custom TCP" then you give port 8080 or whatever you prepare. then save it.
Now go ahead with postman it will work. enjoy your work. !!!!

Related

Forge webhook no callback

I can create a webhook for version added, but I get no callback.
If I send my own POST requests to the callbackUrl I can see them in the log.
The folder urn QU_6r8mIR8yIubm1K_fHmA is the Project Files folder of the Project.
If I use a callback to a https://webhook.site/ I do receive the callback - it is just acc.metroselskabet.dk that sees nothing.
It would be nice to know where the callback is supposed to come from. I have a suspicion that some of Amazon's servers may be blacklisted by Cisco.
Any ideas would be welcome.
autoReactivateHook FALSE
callbackUrl https://acc.metroselskabet.dk/webhook/default/call/packed_data.json
callbackWithEventPayloadOnly FALSE
createdBy umwNi161Og8dY7j4SFpw7EUWCOJGzMXp
createdDate 2022-06-10T09:23:39.323+00:00
creatorType Application
event dm.version.added
hookId dc9998e5-5ce6-40d3-b5c9-e2ea09ed56e0
lastUpdatedDate 2022-06-10T09:23:39.323+00:00
scope folderurn:adsk.wipemea:fs.folder:co.QU_6r8mIR8yIubm1K_fHmA
status active
system data
tenant urn:adsk.wipemea:fs.folder:co.QU_6r8mIR8yIubm1K_fHmA
urn urn:adsk.webhooksemea:events.hook:dc9998e5-5ce6-40d3-b5c9-e2ea09ed56e0
It looks like this is a problem with my Apache SSL. The requests reach the server but the connection dies on SSL Library Error: error:14094416. So nothing to do with Forge, but maybe something with the Amazon web servers.

Browser-sync not loading ASP.NET 5 website using proxy

Browsersync seems stuck loading the website when run in proxy mode. When using the same config but another website it does work, so it must be something in my local setup but I have been unable to figure out what.
I'm running it on Windows, proxying a ASP.NET 5 application which runs on localhost:5000. Directly navigating towards this location works fine. Trying to hook into the pipeline on ASP.NET's side signals the html is exported over the pipeline but the browser never receives a response and stays pending.
The logging output indicates no difference besides a different session and the obvious proxy url if I run it on another website, where also other sites on localhost seems to work (on IIS).
Configuration used (gulp):
gulp.task('browsersync', function () {
browserSync({
proxy: 'localhost:5000',
notify: true,
open: true,
logLevel: 'debug'
});
});

'Try it now' in the Quick Start never returns

I have installed the API Mgr 1.7.0 in Win 7 64. I have been through the Quick Start guide and all appeared to work as described. However, when I get to the point of trying the subscribed-to cdyne api, the 'moving dots' graphic stays there forever. I can't find a way to stop it, other than a browser refresh. I can't see an entry in the API Mgr system logs.
I have removed the parameters and the auth info, which is supposed to return a 401, but it doesn't and the moving dots continue. I'm using Firefox 31, with AdBlock+ and Noscript. There are no blocked scripts as far as I can see.
[edit 1] I get the same problem with the first sample (YouTube). I wonder if the problem is caused by port values? As I have the ESB installed, I increased all the ports for API Mgr by 1. Maybe I missed one, or there is one that hasn't been documented.[/edit 1]
[edit 2] I have reinstalled the API Mgr. I stopped the ESB and left the APIM ports as default. I have recreated the Phone Verify service and I still have same problem with 'Try it now'. I set the global log level to DEBUG, but there is too much detail to be of use. I don't know what package names to set for this problem.
There was an entry in the Application Logs as follows, which might be relevant. The first few lines are shown:
System Error Occurred
Exception occurred while trying to invoke service method getApplicationNames
The following error details are available. Please refer logs for more details.
org.apache.axis2.AxisFault: Exception occurred while trying to invoke service method getApplicationNames
at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:531)
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:370)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:445)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:225)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
at org.wso2.carbon.logging.view.stub.LogViewerStub.getApplicationNames(LogViewerStub.java:3700)
at org.wso2.carbon.logging.view.ui.LogViewerClient.getApplicationNames(LogViewerClient.java:165)
[/edit 2]
Regards, John
You may not have configured CORS. CORS is cross-origin resource sharing [1] and it is used by the try-it feature in the store.
The CORS configuration is stored in [API Manager Home]/reposotiry/conf/api-manager.xml . The header must include the Host name used by the CORS request. The host name being used by the try-it service is shown in gray at the bottom-left hand corner of the API-Console / try-it screen. It should show up as 'base url'. For example: [ base url: http://10.212.0.846.:8281 , api version: 1.0 ]
You may also be having trouble with the default APIs - please make sure that the APIs in [API Manager Home]/repository/deployment/server/synapse-configs/default/api/ are updated with your port offset. This may be preventing basic authentication. It is documented here [2]
Hope that helps.
-Colin
[1] http://en.wikipedia.org/wiki/Cross-origin_resource_sharing
[2] https://docs.wso2.com/display/AM170/Changing+the+Default+Ports+with+Offset

HTTP Proxy or Firewall - I want to find a light http-proxy software,which can be set a whitelist and return 500 to all other links

I'm testing a webpage, which would connect some external Links .
I don't want the page to take too much time to connect them .
So is there any light http-proxy or firewall software, it can be set a white list,
and return 500 directly to all other links that are not in the white list.
Thanks. better if it supports https
I am working with PHP/PHPunit/Win7
duplicate with another question of mine:
Webdriver(Selenium2) - How to make selenium operate elements without wating for connecting to external AD links?
I finally found a simple solution for my condition.
I want to block these Ad requests and tried some firewall and proxy softwares,for example,
comodo,privatefirewall, etc.
comodo is too heavy and complex ,privatefirewall doesn't support wildcards, and firewall would interrupt tests. At last I choosed a proxy software CCproxy.
I create a rule for localhost ,to make it can request my test website domain only, and all other requests are rejected.
Running a test costs about 1-2 minutes before and only 30 seconds now ,it's apparently more stable and fast without connecting to the useless Ad links.
Here're configuration steps:
1.launch CCproxy with Administor privilege( you should set it using Adminisrator in the file property)
2.click Options, select AutoStartup,select AutoDetected for Local IP Address. click OK.
3.create a txt file ,input your domains,like "*.rong360.com*;*.rong360.*;"
4.click Account, select PermitOnly for Permit Category;
click New, input 127.0.0.1 for IP Address/Range;
select WebFilter,click the E button at right side to create a filter;
click the ... button,select the text file you create at Step3,
select PermittedSites. click OK
click OK.
5.click OK to return to the main UI of CCproxy.
6.launch IE and config the local proxy with 127.0.0.1:808
now you can run the tests again , you'll feel better if have same condition :)

forwarding server side DDP connection collections to client

I have backend meteor server which serves and shares common collections across multiple apps (just sharing mongo db is not enough, realtime updates are needed).
BACKEND
/ \
APP1 APP2
| |
CLIENT CLIENT
I have server-to-server DDP connections running between backend server and app servers.
Atm i'm just re-publishing the collections in app server after subscribing them from backend server.
It all seems working quite well. The only problem tho is that in app server cant query any collections in server side, all the find() responses are empty, in client side (browser) it all works fine tho.
Is it just a coincidence that it works at all or what do you suggest how i should set it up.
Thanks
I realize that this is a pretty old question, but I thought I would share my solution. I had a similar problem as I have two applications (App1 and App2) that will be sharing data with a third application (App3).
I couldn't figure out why the server-side of my App1 could not see the shared collections in App3...even though the client-side of App1 was seeing them. Then it hit me that the server-side of my App1 was acting like a "client" of App3, so needed to subscribe to the publication, too.
I moved my DDP.connection.subscribe() call outside the client folder of App1, so that it would be shared between the client and server of App1. Then, I used a Meteor.setInterval() call to wait for the subscription to be ready on the server side in order to use it. That seemed to do the trick.
Here's a quick example:
in lib/common.js:
Meteor.myRemoteConnection = DDP.connect(url_to_App3);
SharedWidgets = new Meteor.Collection('widgets', Meteor.myRemoteConnection);
Meteor.sharedWidgetsSubscription = Meteor.myRemoteConnection.subscribe('allWidgets');
in server/fixtures.js:
Meteor.startup(function() {
// check once every second to see if the subscription is ready
var subIsReadyInterval = Meteor.setInterval(function () {
if ( Meteor.sharedWidgetsSubscription.ready() ) {
// SharedWidgets should be available now...
console.log('widget count:' + SharedWidgets.find().count);
// clean up the interval...
Meteor.clearInterval(subIsReadyInterval);
}
}, 1000);
});
If there is a better way to set this up, I'd love to know.
I have done this already,
check my app Tapmate or youtap.meteor.com on android and iphone,
I know it will work till 0.6.4 meteor version,
haven't checked if that works on above version,
You have to manually override the default ddp url while connecting,
i.e. go to live-data package in .meteor/packages/live-data/stream_client_socket.js
overwrite this - Meteor._DdpClientStream = function (url) {
url = "ddp+sockjs://ddp--**-youtap.meteor.com/sockjs";
now you won't see things happening locally but it will point to meteor server
also disable reload js from reloading
Thanks

Resources