How to connect a web app to a gamefleet instance? - websocket

I've gone over the intro amazon gamelift tutorial, and something I'm trying to understand is how a web app transitions from communicating with the app backend to a gamelift instance.
For example the following call can tell the backend that an available session exists, and returns a list of IP addresses (as well as other information.) Is it a matter of returning that desired IP to the client, and transitioning to a websocket connection with that IP, or are there more authentication details I'm completely missing, etc.?

It looks like the client side SDK for this is still only available in C#:
https://forums.awsgametech.com/t/javascript-as-a-game-client-for-a-gamelift-server/7679/6
If I end up porting this to JS, I'll edit this comment to point to a public repository.

Related

Hosting Microsoft Teams App Messaging Endpoint

I've been following Microsoft's Teams C# tutorials found here, and have been successful for the most part. However, I cannot seem to get my app to work when I host the messaging endpoint myself rather than via their Azure service, which is not an option for me ultimately as the pricing is outrageous for what we need it to do.
I'm hosting the endpoint myself by publishing the sample project and ensuring it's externally available via HTTPS. I can access a custom tab within Teams, so I know that it's online, it's just the messaging endpoint that seems to fail with an "unable to reach app" error when I try and use the messaging extension via a chat window.
When debugging using dev tools, I get 502 error: Bot returned unsuccessful status code Forbidden, error code 1008. Every potential solution I've seen for similar issues hasn't worked for me thus far, though I still feel like it's something incredibly obvious. Are there special steps that need taking when hosting the endpoint yourself? The docs do a very lousy job of explaining the process, probably because Microsoft want you to pay to host the app on Azure.
This is usually caused by the app id / app key not being registered or used correctly in your app, so it's not authenticating to the bot framework service properly. Where/how you do that depends a bit on what sample code / project template you started with, but it's usually somewhere in a .config file (or previously in a .bot file).
The information that you need will be in:
App Id: The Bot Settings page in Azure
App Key: from the Bot settings page, where you got the AppId above, it links to the App registration itself - within there you'll find the section on keys, and you can create a new key (if you've lost the original one)
I know it's generally an error when AppID validation fails. The bot app requests Azure AD to verify the identity.Could your web server access to Azure AD? If you deny to access to outbound with firewall, you should allow Azure IP range.
Turns out it was purely a network issue, that as of yet we still haven't actually figured out. But we tried hosting the app elsewhere and it was fine. That's my recommendation if anyone else has the same problem!

Multiple webhooks in Parse.com

As of Parse's announcement of Cloud Code Webhooks, I've build my own server environment instead of using Parse Cloud Code.
I'm running my server locally, changing the Parse webhook to point at my ngrok tunnel, as described here.
This all works great, but one problem arises when more people from my team, has to work on the server, on the same time. Since the webhook to Parse only can (AFAIK) point to one single webhook URL, we can only have one server running, pointing to its localhost address, through ngrok.
Is anyway to create a workaround for this problem?
Feel free to ask my elaborate on any of my points.

New to ServiceNow, how do I attach a server via web services? (DemoNow)

This might sound completely stupid but I'm new to this.
Anyway, here's my question:
I have a virtual WordPress server (bitnami) running on VirtualBox. Currently it's in my local network with an IP of 192.168.43.11. With a Gravity Forms plugin for WordPress I made a survey website.
How do I attach my survey website to ServiceNow? I think I'm supposed to utilize Service Now Web Services, but I'm lost after that..
Do you know what version your ServiceNow instance is? If it's Eureka or later, you can use the REST API: https://wiki.servicenow.com/index.php?title=Getting_Started_with_REST. All tables are accessible for CRUD operations via the Table API.
If it's prior to Eureka (Dublin, Calgary, etc.) you can use SOAP: https://wiki.servicenow.com/index.php?title=Direct_Web_Services.

How to bring a server online and link it to parse.com?

I have a server of my own running locally on my wifi, on 0.0.0.0:5000.
I have built an app with the parse.com backend, and I want to link this server to Cloud Code, so I can call functions on it.
I am completely lost and don't know where to start to bring my server online with only Parse being able to access it and use its API.
Or am I better off renting a VPS and connecting to that?

White list a program on Azure Database

I am working on a program that uses Azure for it's database. It works pretty good, except that I have to authorize every IP address that I access it from. So, if I go to a friends house I have to authorize that IP, and if I go to a coffee shop I have to authorize that IP...
I am hoping that there is a way to authorize the connection from the program, whatever IP it is coming from. Or, worse case senario, turn off that security measure.
DON'T.
The idea behind Firewalling your DB is to protect your data from anything that could have the SQL Server credentials should they somehow leak. It's for your own safety.
Instead, try to write a quick Web Service with ASP.Net WS/Jax RS/Rails/... to expose the DB data in a sane, secure and thoughtful manner. It's not hard and there are tons of tutorials and books on the matter out there.
Although NOT Recommended, but if you want to turn off this security measure you can allow connections to your SQL database from all IP Addresses by setting the IP address range to 0.0.0.0 - 255.255.255.255 in Azure Portal.
Another alternative would be to dynamically manage allowed IP addresses by using Azure Service Management API. You can manage Firewall rules using this API. You can read more about it here: http://msdn.microsoft.com/en-us/library/azure/dn505717.aspx
So what you could do is have a small service running in Azure. When your application starts, it sends the current IP address to your service and your service sets the IP address in the firewall rules. When the application terminates, it sends another request to your service and then your service removes that IP address from the firewall rule.
As #Machinarius so eloquently said DON'T. .NET already has a way of exposing data through OData services. You get SOAP or Json, LINQ queries, caching, security even down to the entity or operation level.
Exposing an EF model as an OData service is very easy. You can create an ASP.NET Web API OData endpoint using the "Web API 2 OData Controller with actions, using Entity Framework" template as described in the "Creating an OData Endpoint" tutorial.
To call the service from a client, you add a service reference to it and then use the proxy to execute LINQ queries. It could be something as simple as:
Uri uri = new Uri("http://localhost:1234/odata/");
var container = new ProductService.Container(uri);
var myProducts=container.Products.Where(....);
Check "Calling an OData Service From a .NET Client" for a detailed tutorial.
As an alternative, if you need to access your application from random places, why not have a VM configured in Azure with your application installed. And whenever you need your app, fire up that VM, RDP there and work via RDP. Would not need to update connection and much more secure rather then having to allow random IPs to access your database.
I realise this is not an answer to your question, but other stackoverflowers already provided a significant input on your problem. And I do agree with them all. Do not disable the firewall. It is for your own good!

Resources