TIME_WAIT TCP Connections

When a client initiates a disconnection from server, there is an exchange between client and server to inform about the state of disconnection. When the process is finished, the client socket connection states as TIME_WAIT during a variable time. This is a normal behavior, in windows operating systems, this time defaults to about 4 minutes. You can...

Continue reading

Apple Push Notifications - Certificates Based Connections to APNs (Part 4/4)

In the latest entry blog about Apple Push Notifications, I show how use certificates to authenticate against Apple Push Servers. First enter in your developer account and create a new certificate for Apple Push Notification service Once you have downloaded your certificate, the sgcWebSockets HTTP/2 client allows to use 2 security IOHandlers (only f...

Continue reading

Apple Push Notifications - Token Based Connections to APNs (Part 3/4)

In this blog I will show how configure the sgcWebSockets JWT Client to send authenticated HTTP/2 requests to Apple Push Notification Servers. Secure your communications with Apple Push Notification service (APNs) by using stateless authentication Tokens. First you must obtain an Encryption Key and a Key ID from Apple Developer Account. Once a ...

Continue reading

Apple Push Notifications - Send HTTP/2 notifications (Part 2/4)

In the previous blog, I show how retrieve a device token, now I will show how use the HTTP/2 sgcWebSockets client to send a notification (without the authentication part). Send your remote notification payload and device token information to Apple Push Notification service (APNs). How Connect to APNs You must use HTTP/2 protocol and at least TLS 1....

Continue reading

Apple Push Notifications - Register your App (Part 1/4)

sgcWebSockets library supports HTTP/2 protocol on Server and Client side components, Apple Push Notifications only allows to send Push Notifications from a Server Provider using HTTP/2 protocol, so in the following articles I will show how send push notifications using sgcWebSockets library. The Server Provider (who sends the push notifications to ...

Continue reading
Tags:

OAuth2 Client Credentials

OAuth2 Client Component now supports Client Credentials as grant type, this type of grant is commonly used for server-to-server interactions that must run in the background, without immediate interaction with a user. These types of applications are often referred to as daemons or service accounts. OAuth2 Flow Client Credentials  Azure OAuth2 G...

Continue reading

HTTP Post Big Files

sgcWebSockets Servers allow to Post Big Files without affecting the server memory.  When a HTTP client sends a multipart/form-data stream, the stream is saved by server in memory. When the files are big, the server can get an out of memory exception, to avoid these exceptions, the server has a property called HTTPUploadFiles where you can conf...

Continue reading

OpenSSL Perfect Forward Secrecy

From sgcWebSockets 4.4.8 there are small modifications in library to improve security of connections. One of them is Perfect Forward Secrecy When you use the RSA key exchange mechanism, it creates a link between the server's key pair and the session key created for each unique secure session. Thus, if an attacker is ever able to get hold ...

Continue reading

WebSocket Masked Messages

From sgcWebSockets 4.4.8 the Log of websocket messages has been improved. Till now, the messages were saved as was sent/received by socket, this means that when a websocket message was sent by websocket client, this was first masked and then saved to log. As the message was masked, it can't be read easily so the log was useless for the websock...

Continue reading

SChannel Certificates

From sgcWebSockets 4.4.7 the use of Certificates using SChannel as crypto library is supported. The SChannel implementation supports 2 types of certificate authentication: 1. Using a PFX certificate 2. Setting the Hash Thumbprint of an already installed certificate in the windows system. PFX Certificate  PFX Certificate is a file that con...

Continue reading

Binance Futures APIs USDT and COIN

From sgcWebSockets 4.4.7, both Binance Futures APIs are supported: USDT and COIN. USD Futures: https://binance-docs.github.io/apidocs/futures/en COIN Futures: https://binance-docs.github.io/apidocs/delivery/en Configuration  Client can connect to USDT or COIN Binance Futures, set which contract you want to trade using FuturesCon...

Continue reading

Telegram Bot Chat not found

When you log as bot, the GetChats method cannot be used, so you don't get All available chats. If it's the first time you login as Bot and you try to send a message to a known Chat, you will get this error: {"@type":"error","code":5,"message":"Chat not found"} The solution is before send a telegram message, call GetChat method and pass the ChatId a...

Continue reading

Telegram Send Message Bold, Italic...

Telegram client has been improved with a new method, SendRichTextMessages, which supports the use of styles like: bold, italic, underline, strike and code. The use is very simple, if you want send a text in bold, just use the following notation: This is a **bold** text. Markdown Syntax  Bold [ * ] **This is bold message** Italic [ _ ] __T...

Continue reading

AWS Cognito and OAuth2

sgcWebSockets library supports OAuth2 Authentication in Server and Client components, next version will include a new feature required by AWS Cognito service, when you try to authenticate using OAuth2 with Cognito, the service requires that the Server listens on a Secure port, so now OAuth2 Client component can use SSL/TLS encryption layer. The Loc...

Continue reading

HTTP/2 Alternate Service

The Alt-Svc HTTP header is used to inform the clients that the same resource can be reached from another service or protocol, this is useful if you want inform the HTTP clients that your server supports HTTP/2 for example. Example: if your server is running on a local IP 127.0.0.1 and is listening on 2 ports: 80 (non encrypted) and 443 (encrypted)....

Continue reading

WebSocket Client Before Connect and Before WatchDog

WebSocket Client can be customized with some of the events available. There are 2 new events added to the latest version: OnBeforeConnect: this event is called just before the client tries to connect to server OnBeforeWatchDog: sgcWebSocket client has a built-in method to reconnect after a disconnection called WatchDog, this event is called before ...

Continue reading

Forward HTTP Requests

From  sgcWebSockets 4.4.6, forward HTTP requests is supported. Reverse proxy is useful when there is a single server listening on a public port and behind it there are other servers that cannot be accessed from a public address.  Example: you can serve all HTTP requests using our sgcWebSockets server and forward to another serve...

Continue reading

HTTP/2 Server Push

A new feature has been added to Indy Servers, now Server Push is supported by sgcWebSockets library. HTTP usually works with Request/Response pattern, where client REQUEST a resource to SERVER and SERVER sends a RESPONSE with the resource requested or an error. Usually the client, like a browser, makes a bunch of requests for those assets...

Continue reading

OAuth2 Customize Sign-In HTML

When an OAuth2 client do a request to get a new Access Token, a Web-Page is shown in a web-browser to Allow this connection and login with an User and Password. The HTML page is included by default in Server component, but this code can be customized using OnAuth2BeforeDispatchPage event. procedure OnOAuth2BeforeDispatchPage(Sender: TObject; OAuth2...

Continue reading

OAuth2 Server Allow none authenticated requests

By default, when OAuth2 is enabled on Server Side, all the HTTP Requests require Authentication using Bearer Tokens. If you want allow some URLs to be accessed without the need of use a Bearer Token, you can use the event OnOAuth2BeforeRequest Find below a sample code which shows the use of the event. procedure OnOAuth2BeforeRequest(Sender: TObject...

Continue reading