Clojure Pedestal Windows WSL2 browsers not rendering - clojure

I finished a pedestal clojure app and used the repl to start the server which it starts.
I can only curl and can't access the project on any browser with localhost:8080. I did the frontend with Clojurescript/Shadowcljs which works fine in the browser, so it can't be an overall issue via localhost (a host issue).
To further check issues I followed step by step this tutorial app (just to be 100% sure), and it too only loads via curl and not in the browser as the tutorial states it should be able to load in the browser (not changing any code).
I am using Windows wsl2 with all my apps of varies languages but this one with clojure and pedestal won't load in the browser no matter if I even try the dockerfile included.
Thank You for any help you can give me on this situation because I am lost.

So I was curios the way I got it to work was by adding> Thats using a browser on windows side to wsl linux using http://localhost:8080/
::http/host "0.0.0.0"
to
(def service {:env :prod
::http/host "0.0.0.0"
::http/routes routes
::http/resource-path "/public"
::http/type :jetty
::http/port 8080})
I found the info at
https://www.bleepingcomputer.com/news/security/wsl2-now-supports-localhost-connections-from-windows-10-apps/
https://github.com/pedestal/pedestal/issues/604#issuecomment-529469681

Related

[local IP]:[PORT] redirects to public website (Flask, server configuration, local environment)

I want to debug a flask app on mobiles.
My application configuration allows to expose the app to the network:
application.run(host= '0.0.0.0',port=5000,threaded=True)
However, if I load mylocalIP:5000, it redirects to www.example.com, where the production site is hosted, and cannot figure out where it is written to resolve the redirect.
So I cannot see my local environment but in my local machine, and cannot debug the app on other machines - like mobile phones.
Where should I look to solve the problem ?
I must have changed configuration on my machine somewhere, I don't think it is related to flask.
Note: as alternative , I tried use my local host alias:
I'm using a mac, System Preferences > Sharing > Internet Sharing is enabled, other computers in local networks can access my local env at myLocal.local host, but still access to myLocal.local:5000 is forbidden for other machines but my computer.
You can do one thing, install Fiddler app and configure the reverse proxy on your mobile phone. This tutorial will help you to configure fiddler in android applications.
After configuring the reverse proxy, run the flask application on localhost or machine IP and you can access your machine IP on your mobile. Fiddler would also help you to intercept all the calls made to your application. If you don't want to inspect via fiddler you can directly put your mobile on same network of application.

Communicating Between Two EC2 Servers - AWS

I have two EC2 servers. One runs Windows Server 2012 R2 and the other runs on Amazon's Linux build. The Linux box is used as a web server with PHP doing the scripting. I would like the Linux server to send a string to the Windows server every time a PHP file (acting as a RESTful end-point) is processed.
I've never done anything similar and was wondering where to start. From the research I've done so far, it seems like using Netcat to create a Telnet connection might do the job. If so, what would the boilerplate code look like? Netcat is a pretty old platform and there's not much to be found in terms of examples from a Google search.
I am also open to other solutions that could solve this problem.
The workflow of what I am trying to do looks like:
A user hits PHP file end-point -> PHP or the server it runs on sends a string to the Windows Server -> Windows server receives the string and starts a script
You could think of exposing this as an endpoint on your Windows server using either of:
IIS + PHP
IIS + CGi/Perl
IIS + Asp
or anything else.
Expose a simple page on IIS (Windows web server) and hit that from within your webservice login (Linux server) whenever the Linux server receives a request. The script/page that is exposed by your Windows server could execute the desired script then.
The page/endpoint that is exposed on the Windows server should be protected so that not anyone could execute it (disabling public ips. Restricting only the Linux server Ip in your firewall rules etc.)
Sample
Within your php webservice - $my_var = file_get_contents('http://WinServerPrivateIp/runScript.pl'); // Make it asynchronous if needed
runScript.pl in Windows - Would execute your actual script.
You could look at calling winexe from within PHP. I haven't done it myself but I've read that this should do the trick.
winexe Sourceforge
Some sample code from within PHP here
I hope that this is of some help to you
Regards
Liam

Facebook Debugger unable to test localhost

I am building a Facebook app using Django. So, for development, I connected the app to localhost. My app is loading on canvas and working fine but the Facebook debugger is unable to test it correctly when I give localhost address as input.
These are the requests I tried in debugger
http://localhost
https://localhost/
http://127.0.0.1/
localhost
etc
Almost for all possible combinations.. It showed me
Error Parsing URL: Error parsing input URL, no data was scraped.
When I deployed the same code on heroku and tried.. It was working!
So,
Can't I debug the project on localhost? What's the point in working on it then??
If I can work, how should I fix it?
Can't I debug the project on localhost? What's the point in working on it then??
You can debug your code etc. on localhost – but of course you can’t have Facebook’s debug tool reach a site on your localhost, because Facebook (and everyone else on the web) does have no idea what machine your localhost actually is. (Absolute bascis, dude!)
If I can work, how should I fix it?
You have to make your web server accessible from the “outside”, over the internet.
Set up your test server so that it accepts requests from outside IPs, and get a DynDNS address (basically something that can be resolved by third parties like Facebook over the DNS).
You can access Facebook apps locally but you need to fake the domain of your local computer. You can do this by adding
127.0.0.1 mysite.test.example.com
to /etc/hosts. You should update mysite.test.example.com to your domain. Your Facebook app needs to be configured for that domain. You can then use the Facebook app locally and debug your project.
The alternative is to setup up a web server and use its domain for testing purposes (but this is not ideal because you'll need to commit and build the code before you can see your changes).

call jboss web service from other machine

I've created a contract-last web-service which is deployed on a Jboss AS on my VDI machine. I can get the WSDL just fine from localhost, but if I try to call the webservice from my laptop or any other machine I simply cannot connect to it.
I'm using SoapUI to test with and I just get a NullPointerException when I call it and if I try to get the WSDL via a browser it just times out.
I've tried to use a listener to see if I can connect to the VDI from other machines and that works just fint.
Any suggestions what I could try? - I'm thinking that it could be some property setting in some Jboss AS properties file, but the only thing I've found is "jboss.bind.name" which is set to "0.0.0.0" which should allow other machines to connect to the web-service, but no luck :/
Hilfe?
The solution was to add "-b 0.0.0.0" to my startup script

GlassFish Server (open source) ColdFusion "requested resource is not available" error

We are in the process of moving a website coded in ColdFusion and Fusebox framework to a new host (from GoDaddy who is ceasing to support CF to HostMySite).
Our url structure is currently setup like /index.cfm/home.register redirecting through a cfscript to the "full" url of /index.cfm?fuseaction=home.register
We are receiving the following error message:
HTTP Status 404 -
type Status report
message
descriptionThe requested resource () is not available.
GlassFish Server Open Source Edition 3.1
I am not a CF or Windows guy, this is an old site and we are just trying to get it to run on another server to bide us some time until we can rewrite it.
Any clue as to how to what is wrong and how to get it to work? HostMySite support has been completely unresponsive thus far.
Any help would be greatly appreciated!
Brandon, just for the sake of correctness; Glassfish is Oracle's java server and comes in an open source flavour. http://glassfish.java.net/
Glassfish is not a ColdFusion server.
It is possible to deploy j2ee versions of Adobe ColdFusion, Railo or OpenBD using glassfish.
JRun is the only Java server that comes with the SES rewriting built in. However, it is possible to rewrite urls using most Java servers or at the least by fronting the java server with a web server such as IIS, Apache or nginx.
After several discussion with tech support, we confirmed that "GlassFish Server" is an open source ColdFusion server, and it does not support the search engine friendly URL code we were using. We had to switch hosts to a host that used actual CF server.