laravel echo server , redis - redis

i have a problem with remote connections.
my vhost is : redis.test
i added this on blade file:
<script src="//redis.test:6001/socket.io/socket.io.js"></script>
.env file
BROADCAST_DRIVER=redis
REDIS_HOST=redis.test
REDIS_PASSWORD=null
REDIS_PORT=6379
echo configuration
import Echo from "laravel-echo"
window.Echo = new Echo({
broadcaster: 'socket.io',
host: 'http://redis.test:6001'
});
laravel-exho-server.json
{
"authHost": "http://redis.test",
"authEndpoint": "/broadcasting/auth",
"clients": [
{
"appId": "f27485125ac2627f",
"key": "6328e672f42cbf4cba1de3da215ec41a"
}
],
"database": "redis",
"databaseConfig": {
"redis": {
"port": "6379",
"host": "redis.test"
},
"sqlite": {
"databasePath": "/database/laravel-echo-server.sqlite"
}
},
"devMode": true,
"host": "redis.test",
"port": "6001",
"protocol": "http",
"socketio": {},
"sslCertPath": "",
"sslKeyPath": ""
}
it works when i try to broadcast with a local connection (2 browsers - same pc), but when i try to send a "message" from other pc on lan network (192.168.1.50) i have this error
GET: http://redis.test:6001/socket.io/socket.io.js net::err_connection_refused
[vue_warn] error in created hook
how ca i resolve this?

It may be a firewall issue as I can see, try to open redis port in the firewall

Related

Why is Ocelot ignoring the first route in my JSON file?

I have implemented Ocelot API Gateway in my Net Core 7 application. One of the JSON files containing routes is set up as follows:
{
"Routes": [
{
"DownstreamPathTemplate": "/storedfiletype",
"DownstreamScheme": "https",
"DownstreamHostAndPorts": [
{
"Host": "<<<HOST DELETED FOR SECURITY>>>",
"Port": 443
}
],
"UpstreamPathTemplate": "/fileserver/storedfiletype",
"UpstreamHttpMethod": [ "Post" ]
},
{
"DownstreamPathTemplate": "/storedfiletype/fileextension",
"DownstreamScheme": "https",
"DownstreamHostAndPorts": [
{
"Host": "<<<HOST DELETED FOR SECURITY>>>",
"Port": 443
}
],
"UpstreamPathTemplate": "/fileserver/storedfiletype/fileextension",
"UpstreamHttpMethod": [ "Post" ]
}
]
}
Now when I try and post to the first route (/storedfiletype in this case), I get a 404 error but the second route works. When I swap them over (making /storedfiletype/fileextension the first route), /storedfiletype works and /storedfiletype/fileextension gives me the 404 error.
Any ideas?

Can I use Ocelot API Gateway to proxy to a Website

I am new to Ocelot API Gateway and trying to figure out how to perform a response host rewrite?
My ocelot api gateway is hosted on localhost:5000, the downstream server is on another host example.com. I am able to proxy from localhost:5000 to example.com, however, when example.com sends a response I get redirected to example.com. I need to stay within one domain (localhost:5000).
Any help is appreciated
{
"ReRoutes": [
{
"DownstreamPathTemplate": "/example/{all}",
"DownstreamScheme": "https",
"DownstreamHostAndPorts": [
{
"Host": "example.com",
"Port": 443
}
],
"UpstreamPathTemplate": "/example/{all}",
}
],
"GlobalConfiguration": {
"BaseUrl": "https://localhost:5000"
}
}
A bit late, but I think you need a "DownstreamHeaderTransform", which will change back example.com to localhost:9000. (not sure if the port will be mapped correctly). In our use case, we use the IP address of the downstream server, and then map that back to the host that the outside world sees. For you, try something along these lines:
{
"ReRoutes": [
{
"DownstreamPathTemplate": "/example/{all}",
"DownstreamScheme": "https",
"DownstreamHostAndPorts": [
{
"Host": "example.com",
"Port": 443
}
],
"DownstreamHeaderTransform": {
"Referrer": "https://example.com, https://localhost:5000",
"Host": "example.com, localhost:9000",
"Origin": "https://example.com, https://localhost:5000"
},
"UpstreamPathTemplate": "/example/{all}",
}
],
"GlobalConfiguration": {
"BaseUrl": "https://localhost:5000"
}
}
Personally, I found Ocelot to be rather finiky, and would try Kestrel instead.

Anyone success in config collinder for apprtc

My question in github:
https://github.com/webrtc/apprtc/issues/615
I can't config apprtc for signal server, just call video ok via wifi but via mobile network has no luck.
Please view my config, I can't find any example for constands.py in anywhere.
Here is my config:
ICE_SERVER_OVERRIDE = [
{
"urls": [
"stun:stun.l.google.com:19302"
]
},
{
"urls": [
"turn:my_ip_address:3478?transport=udp"
],
"username": "my_account",
"credential": "password"
},
{
"urls": [
"turn:my_ip_address:3479?transport=udp"
],
"username": "my_account",
"credential": "password"
}
]
TURN_SERVER_OVERRIDE = [
{
"urls": "turn:my_ip_address:3478",
"username": "my_account",
"credential": "password"
},
{
"urls": "stun:stun.l.google.com:19302"
}
]
TURN_BASE_URL = 'http://my_url.com'
TURN_URL_TEMPLATE = '%s/turn?username=%s&key=%s'
CEOD_KEY = ''
ICE_SERVER_BASE_URL = 'http://my_url.com'
ICE_SERVER_URL_TEMPLATE = '%s/v1alpha/iceconfig?key=%s'
ICE_SERVER_API_KEY = os.environ.get('ICE_SERVER_API_KEY')
Dictionary keys in the collider instance info constant.
WSS_INSTANCE_HOST_KEY = 'my_ip_address:8443'
WSS_INSTANCE_NAME_KEY = 'wsserver-std'
WSS_INSTANCE_ZONE_KEY = 'us-central1-a'
WSS_INSTANCES = [{
WSS_INSTANCE_HOST_KEY: 'my_ip_address:8443',
WSS_INSTANCE_NAME_KEY: 'wsserver-std',
WSS_INSTANCE_ZONE_KEY: 'us-central1-a'
}, {
WSS_INSTANCE_HOST_KEY: 'apprtc-ws-2.webrtc.org:443',
WSS_INSTANCE_NAME_KEY: 'wsserver-std-2',
WSS_INSTANCE_ZONE_KEY: 'us-central1-f'
}]
WSS_HOST_PORT_PAIRS = [ins[WSS_INSTANCE_HOST_KEY]
When I run it, my apprtc return error:
WebSocket open error: WebSocket error.
So, I don't understand what keys mean:
WSS_INSTANCE_HOST_KEY: 'my_ip_address:8443',
WSS_INSTANCE_NAME_KEY: 'wsserver-std',
WSS_INSTANCE_ZONE_KEY: 'us-central1-a'
When I change to default in original code, it work but ONLY via Wifi, No mobile network working, I also run turnserver in port 3478 and collinder in 8443 with pem files.
So any one can tell me how to test collinder and turnserver config successfully for mobile connecting?
I found the error during two years ago to config apprtc:
Just config ICE servers like this:
ICE_SERVER_OVERRIDE = [
{
"urls": [
"stun:stun.l.google.com:19302"
]
},
{
"urls": [
"turn:my_ip_address:3478?transport=udp"
],
"username": "my_account",
"credential": "password"
},
{
"urls": [
"turn:my_ip_address:3479?transport=udp"
],
"username": "my_account",
"credential": "password"
}
]
ICE_SERVER_BASE_URL = 'http://my_url.com'
ICE_SERVER_URL_TEMPLATE = '%s/v1alpha/iceconfig?key=%s'
ICE_SERVER_API_KEY = os.environ.get('ICE_SERVER_API_KEY')
and in /etc/turnserver.conf
cert=/root/cert.pem
pkey=/root/key.pem
listening-port=3478
tls-listening-port=5349
listening-ip=my_ip_address
relay-ip=my_ip_address
external-ip=my_ip_address
realm=my_web_address
server-name=my_web_address
#lt-cred-mech
userdb=/etc/turnuserdb.conf
oauth
user=my_account:my_password
no-stdout-log
Reson of error is: when I config "lt-cred-mech" authentication, It was failed.
So, I change it to "oauth": It Worked.
test Turn Server (Collinder) in this website:
https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/
# The result very fast (like sturn url of Google):
0.005 1 host 3868393361 udp 192.168.1.157 35353 126 | 30 | 255
0.006 1 host 891932622 udp xxxx:xxxx:12c7:xxxx:247e:xxxx:3c18:xxxx 51606 126 | 40 | 255
0.009 1 srflx 842163049 udp aa.bb.cc.dd 3341 100 | 30 | 255
0.062 1 relay 3031532034 udp my_turn_ip_address 62030 2 | 30 | 255
0.105 Done
0.109

Connecting SQL Server (local server) in VS code using xampp

Connecting my local server (created with xampp) with SQL Server in VS code, how is it possible?
{
"mssql.connections": [
{
"server": "localhost",
"database": "Haani",
"user": "sa",
"password": "",
"authenticationType": "SqlLogin",
"emptyPasswordInput": true,
"savePassword": true
}
]
}

How to correctly deploy multi meteor instances WITH SSL on one digitalocean droplet using mup?

my mup.json config for first meteor instance:
{
"servers": [
{
"host": "111.222.333.444",
"username": "root",
"password": "mypass"
}
],
"setupMongo": true,
"setupNode": true,
"nodeVersion": "0.10.40",
"setupPhantom": false,
"enableUploadProgressBar": true,
"appName": "myapp1",
"app": "../myapp1",
"env": {
"PORT": 3001,
"ROOT_URL": "https://my.domain.com"
},
"ssl": {
"pem": "./ssl.pem"
},
"deployCheckWaitTime": 15
}
So after deployment I want to get access to this instance by https://my.domain.com:3001. Then with similar configuration I want to deploy second instance to same droplet and get access to it by https://my.domain.com:3002.
The problem is that after deployment accessing by https taking ERR_CONNECTION_CLOSED, but accessing by http is OK.
How can I make it working?
Finally, I did it.
Firstly, I used mupx. But there I had troubles too. Later I found that my fault was writing same ports for different apps or protocols. So, there is working configurations of first and second apps:
{
"servers": [{
"host": "111.222.333.444",
"username": "root",
"password": "mypass",
"env": {}
}],
"setupMongo": true,
"appName": "myapp1",
"app": "../myapp1",
"env": {
"PORT": 8000,
"ROOT_URL": "http://my.domain.com"
},
"deployCheckWaitTime": 15,
"enableUploadProgressBar": true,
"ssl": {
"certificate": "../ssl/bundle.crt",
"key": "../ssl/private.key",
"port": 8001
}
}
{
"servers": [{
"host": "111.222.333.444",
"username": "root",
"password": "mypass",
"env": {}
}],
"setupMongo": true,
"appName": "myapp2",
"app": "../myapp2",
"env": {
"PORT": 8100,
"ROOT_URL": "http://my.domain.com"
},
"deployCheckWaitTime": 15,
"enableUploadProgressBar": true,
"ssl": {
"certificate": "../ssl/bundle.crt",
"key": "../ssl/private.key",
"port": 8101
}
}
bundle.crt and private.key are common for all apps.
Don't forget to use mupx.
So after
mupx setup
mupx deploy
We can get access for first app by
http://my.domain.com:8000
https://my.domain.com:8001
And for second app by
http://my.domain.com:8100
https://my.domain.com:8101
EDIT: accessing by http is not working. I don't know why, maybe it just for my configuration. But this feature I don't need, I need only https. So if you know how to fix, please, write.
EDIT2: it's alright, http access works. The reason was Chrome browser, it always redirects my domain from http to https. After cleaning browser history it do all good.