socket_connect keeps failing with permission denied - laravel

I am running into the following error message:
socket_connect(): unable to connect [61]: Connection refused
The code that I am using:
$address = 'localhost';
$port = 5600;
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
socket_connect($socket, $address, $port);
I was trying this out on a valet .dev environment with nginx so I guessed it might have to do with not having a proper development environment that supports websockets but after testing I am getting the exact same on my homestead vagrant environment.
Any help with getting more verbose debugging information or a possible solution would be amazing.
All suggestions are welcome.
Cheers.

The server was not running properly. I could not map the code 61 to any error message by searching for it online.
If anybody encounters this with a code 61 I suggest looking at your websocket server and check if it is running properly.

Related

Can't force phpMailer to send mail from nginx server

I use actual version of phpMailer (downloaded yesterday from github). It sends mails from my local computer (Win10, xampp 7.4.3) and can't send it from server (centOs7, nginx, php7). Both computers in one LAN behind the same firewall.
I suspect php.ini configuration, but what should be configured exactly?
Thanks for any help.
The solution:
# sudo setsebool -P httpd_can_sendmail 1
The tracking of my search:
Switch on the DebugMode in phpMailer (for each new PHPMailer object):
$mail = new PHPMailer\PHPMailer\PHPMailer();
$mail->SMTPDebug = 4;
Checking out 'Console' tab output in Chrome DevTools:
SMTP ERROR: Failed to connect to server: Permission denied (13)
Googling for the error text - https://stackoverflow.com/a/50302148/9751142
Hope this helps anybody else.

Mulesoft - SFTP Component to go through SOCKS Proxy

I was hoping someone could help.
I am trying to sftp to a remote server that is behind a firewall. I have a proxy setup and can sftp via the unix terminal succesfully. However when using mulesofts SFTP connector I get a timeout. From research it looks like this is because it is run on the JVM.
Mule comes with wrapper.conf to update any jvm settings so I have set the following settings:
wrapper.java.additional.15=-DsocksProxyHost:hostname
wrapper.java.additional.16=-DsocksProxyPort=1080
When I do this the Mule service no longer runs and get the following error:
WrapperManager Error: Unexpected exception opening backend socket: java.net.SocketException: Can't connect to SOCKS proxy:Invalid argument or cannot assign requested address
Hopefully someone can assist.
Thank you.
Perhaps typo in the
-DsocksProxyHost:hostname
Should be = rather than :.
The port is unnecessary, 1080 is the default. Documentation is here, see section 2.4 for SOCKS
http://docs.oracle.com/javase/8/docs/technotes/guides/net/proxies.html

how to solve tunneling socket could not be established error?

When I issue below command, I'm getting this error. please help me to solve.
heroku run bash
Running bash on myapp... !!!
▸ ECONNRESET: tunneling socket could not be established, cause=Parse Error
! Error in heroku-run:
! getaddrinfo ENOTFOUND api.rollbar.com api.rollbar.com:443
! See /home/simon/.heroku/error.log for more info.
Note: I have http_proxy and https_proxy
certainly your proxy doesn't allowed to connect with heroku server... Please try with other system or change the proxy and try again...

Connection Refused for Shinyapp Authorization - Proxy? Firewall?

When I try to authorize my account for shinyapps, I receive the following error:
Error in function (type, msg, asError = TRUE) :
Failed to connect to api.shinyapps.io port 443: Connection refused
I know that it has something to do with my proxy or firewall settings, but I do not know how to get around this.
I am not sure how to specify a proxy for \code{rcurl} and \code{curl} connections - as I think this may be the fix?
Any help is appreciated!
If you're using the shinyapps package you can read the proxy documnation by running the following commands from your R console:
?shinyapps::rsconnectProxies

Getting error 'Excon nonblock is not supported by your OpenSSL::SSL::SSLSocket' (Heroku)

When trying to push my app to Heroku, it is hanging and I get this message:
ssh: connect to host heroku.com port 22: Operation timed out
When running:
heroku status
I am getting the error:
Excon nonblock is not supported by your OpenSSL::SSL::SSLSocket
Does anyone know what this means and how I can fix it?
I figured out the problem. My company has blocked a ton of stuff so it has something to do with that. When I tried using my phone as a wifi hotspot it worked fine so it has something to do with my network connection at work.

Resources