https://latex.codecogs.com/eqneditor/editor.php
COMMAND : write the swiftui code to connect to a secure REST service and upgrade to a secure websocket if available
Here's an example of how to use SwiftUI to connect to a secure REST service and upgrade to a secure WebSocket if available using URLSession and URLSessionWebSocketTask:
import SwiftUI
import Combine
class DataService: ObservableObject {https://webservice.rakuten.co.jp/explorer/api/Product/Search
var RAKUTEN_SEARCH = "https://app.rakuten.co.jp/services/api/IchibaItem/Search/20220601?format=json&keyword=%E6%A5%BD%E5%A4%A9&genreId=100371&applicationId=e06e2a5afcf14b52139c1fb6c58e9dbc"
var respObj = {How to use Nginx as a Reverse proxy for HTTPS and WSS - Self Signed Certificates and Trusted Certificates
Nginx is a web server, also works as a load balancer, and may help us a lot in security and routing terms, because when deploying our applications to a production environment, we don’t want to put ports on the url, and also the dns has to look like clean to our users, also for security reasons, we don’t want to show the port explicitly where the service is being run. Also, I decided to make this tutorial, because I was working on a cryptocurrency exchange platform in a freelancing job, and the frontend communicates with the relayer(backend that receives the user order's for exchanging Tokens/Crypto) by HTTPS and WSS. The HTTP it was for the general APIs and for posting new buy/sell orders, and the Websockets was for making a full-duplex communication for near realtime u
| upstream websocket { | |
| server localhost:3000; | |
| } | |
| server { | |
| listen 80; | |
| server_name localhost; | |
| access_log /var/log/nginx/websocket.access.log main; |
| from algoliasearch import algoliasearch | |
| import pymongo | |
| from pymongo import MongoClient | |
| import json | |
| client = algoliasearch.Client("Your_Application_ID", 'Your_API_Key') | |
| index = client.init_index('Experiment_1') | |
| MONGODB_URL1 = 'Your_MongoDB_Connection_String' | |
| def move_collection(from_collection): |
| extension Array { | |
| subscript(circular index: Int) -> Element? { | |
| var i = index | |
| if i < 0 || isEmpty { | |
| return nil | |
| } else if i > count - 1 { | |
| i = index % count | |
| } | |
| return self[i] | |
| } |
| #import "NSURLRequest+DummyInterface.h" | |
| @implementation NSURLRequest (IgnoreSSL) | |
| + (BOOL)allowsAnyHTTPSCertificateForHost:(NSString*)host | |
| { | |
| // ignore certificate errors only for this domain | |
| if ([host hasSuffix:@"http://localhost"]) | |
| { | |
| return YES; | |
| } |
| #import <Foundation/Foundation.h> | |
| @interface NSURLRequest (IgnoreSSL) | |
| + (BOOL)allowsAnyHTTPSCertificateForHost:(NSString*)host; | |
| @end |
hack you certs on mobile device
Read more ... Localhost cert hacks
Anyone can make their own certificates without help from a CA. The only difference is that certificates you make yourself won’t be trusted by anyone else. For local development, that’s fine.
The simplest way to generate a private key and self-signed certificate for localhost is with this openssl command: